import random
def monte_carlo_pi(num):
count = 0
for i in range(num):
x, y = random.uniform(-1, 1), random.uniform(-1, 1)
if x**2 + y**2 <= 1:
count += 1
return 4 * count / num
if __name__ == '__main__':
sd = int(input())
random.seed(sd)
times = int(input())
print(monte_carlo_pi(times))