import java.math.BigDecimal;
import java.util.Scanner;
public class Main {
public BigDecimal goldenCoin(double n){
BigDecimal p;
if (n >= 990){
p = new BigDecimal("1");
}else {
BigDecimal m = new BigDecimal("1");
for (int i = 0; i < n ; i ++){
m = m .multiply (new BigDecimal(Double.toString(990 - i)));
m = m.divide(new BigDecimal(Double.toString(1000 - i)), 6, BigDecimal.ROUND_HALF_UP);
}
p = new BigDecimal(1) .subtract(m) ;
}
return p;
}
public static void main(String[] args){
Scanner in = new Scanner(System.in);
double n = in.nextDouble();
Main goldenCoin = new Main();
System.out.println(goldenCoin.goldenCoin(n).setScale(6,BigDecimal.ROUND_HALF_UP));
}
}