#include<iostream>
#include<iomanip>
using namespace std;
int main(){
    string shape;
    double md1,d2;
    cin>>shape;
    if(shape == "circle"){
        cin>>d1;
        cout<<fixed <<setprecision(2)<<3.1416*d1*d2;
        }
        else if(shape == "rectangle"){
            cin>>d1>>d2;
            cout<<fixed<<setprecision(2)<<d1*d2;
        }
        else{
            cout<<"Invalid shape type;"
        }
        return 0;
}