#include<iostream>
#include<cstdio>
#include<math.h>
using namespace std;
int main(){
int n, y;
double f = 1;
cin>>n;
for(int i=1;i<=n;i++){
y = 1;
for(int x=1;x<=i;x++){
y *= x;
}
if(i%2 == 0){
f += pow(y, -1);
}
else if(i%2 == 1){
f -= pow(y, -1);
}
}
printf("%.8f", f);
return 0;
}