import java.util.Scanner; //这次牛牛又换了个数列,他想计算:1+1/2+1/3+…+1/N的值。(保留6位小数) public class Test4 {public static void main(String[] args) {Scanner scanner=new Scanner(System.in);int n=scanner.nextInt();double sum=0;for (int i = 1; i <=n ; i++) {sum=sum+1.0/i;}System.out.printf("%.6f",sum);} }