#include #define rep(i, l, n) for (int i = (l); i < (n); i++) using namespace std; int main(void) { int n; cin >> n; double p; cin >> p; assert(n >= 1 and n <= 1000 and p > 0 and p < 1.0); if (n >= 200) { cout << 1 << endl; return 0; } double a = 1.0; double q = 1.0 - p; rep(i, 0, n) { a *= q; } cout << (1.0 - a) << endl; return 0; }