#include int main(){ float f; double pi,i,sign; while(scanf("%f",&f)==1) { pi=0; i=1; sign=1; do { pi+=sign*1.0/i; }while(1.0/i>=f&&(sign=-sign)&&(i+=2)); printf("%lf\n",pi*4.0); } return 0;}