import java.util.*;
class Shape{
    double area(double r){
        return Math.PI *r*r;
    }
    double area(double len, double bre){
        return len*bre;
    }
    double area(double s){
        return s*s;
}
}
public class Main{
    public static void main(String [] args){
        Scanner sc = new Scanner(System.in);
        String input = sc.nextLine();
        Shape shape = new Shape();
        if(input.equals("Circle")){
            double r = sc.nextDouble();
            if(r<0){
                System.out.println("Invalid input");
                System.exit(0);
            }
            System.out.printf("%.2f%n",shape.area(r));
        }
        else if(input.equals("Rectangle")){
            double len = sc.nextDouble();
            double bre = sc.nextDouble();
            if(len<0 || bre<0){
                System.out.println("Invalid input");
                System.exit(0);
            }
            System.out.printf("%.2f%n",shape.area(len,bre));
        }
        else if(input.equals("Square")){
            double s = sc.nextDouble();
            if(s<0){
                System.out.println("Invalid input");
                System.exit(0);
            }
            System.out.printf("%.2f%n",shape.area(s));
        }
        else{
            System.out.println("Invalid input");
        }
    }
}