import math pi = 3.14159265358979323846264338 dpi = 2 * pi n = int(input()) S = 0 for i in range(n): x, a = map(float, input().split()) if x != 0: S += a * pi else: S += a * dpi print(S)