n =input("输入一个数:")
n =int(n)
sum =1/n
x =2
y =1
while x < n:
if n %2 ==0:
sum = sum + (1/x)
x+=1
print(sum)
break
elif n %2 !=0:
sum = sum + (1/y)
y +=1
print(sum)
break
n =input("输入一个数:")
n =int(n)
sum =1/n
x =2
y =1
while x < n:
if n %2 ==0:
sum = sum + (1/x)
x+=1
print(sum)
break
elif n %2 !=0:
sum = sum + (1/y)
y +=1
print(sum)
break