#include <iostream>
using namespace std;
int main() {
int a,n,m;
double s=0,q;
cin>>n;
for(int i=1;i<=n;i++){
m=i;
q=1;
for(int j=1;j<=m;j++){
q=q*2;
}
s+=(2*i-1)/q;
}
cout<<s<<endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwppbnQgbWFpbigpIHsKCWludCBhLG4sbTsKCWRvdWJsZSBzPTAscTsKCWNpbj4+bjsKCWZvcihpbnQgaT0xO2k8PW47aSsrKXsKCQltPWk7CgkJcT0xOwoJCWZvcihpbnQgaj0xO2o8PW07aisrKXsKCQkJcT1xKjI7CQoJCX0KCQlzKz0oMippLTEpL3E7Cgl9Cgljb3V0PDxzPDxlbmRsOwoJcmV0dXJuIDA7Cn0=