using namespace std;
int main(){
int n; cin>>n; cout<<fixed<<setprecision(2); if(n*M>P)cout<<n*M*D<<endl; else cout<<n*M<<endl; return 0;
}