#include using namespace std; int main(){ int n; cin >> n; double p; cin >> p; if(n >= 200){ cout << 1 << endl; return 0; } double ans = 0, q = 1.0; for(int i = 0; i < n; ++i){ ans += q * p; q *= 1 - p; } cout << setprecision(16) << ans << endl; return 0; }