#include<stdio.h>

int main(void){
  int i,j,x;
  double n,ans,y;

  while(scanf("%lf",&n),n){
    x=2;
    y=1;
    ans=n-1;
    for(i=0;i<n-1;i++){
      y=y/x;
      x*=2;
      }
    printf("%f\n",ans+y);
}

  return 0;
}