import math def trigamma(x): if x >= 10: return trigamma_asymptotic(x) else: m = max(0, math.ceil(10 - x)) sum_part = sum(1.0 / (x + k)**2 for k in range(m)) return sum_part + trigamma(x + m) def trigamma_asymptotic(x): result = 1.0 / x result += 1.0 / (2 * x**2) result += 1.0 / (6 * x**3) # Terms from Bernoulli numbers up to B_20 terms = [ (-1/30, 5), # B_4 term: -1/(30*2x^5) → -1/(60x^5) (1/42, 7), # B_6 term: 1/(42*3x^7) → 1/(126x^7) (-1/30, 9), # B_8 term: -1/(30*4x^9) → -1/(120x^9) (5/66, 11), # B_10 term:5/(66*5x^11) → 1/(66x^11) (-691/2730, 13), # B_12 term: -691/(2730*6x^13) (7/6, 15), # B_14 term:7/(6*7x^15) →1/(6x^15) (-3617/510, 17), # B_16 term:-3617/(510*8x^17) (43867/798, 19), # B_18 term:43867/(798*9x^19) (-174611/330, 21)# B_20 term:-174611/(330*10x^21) ] for B, exponent in terms: term = B / (x ** exponent) result += term if abs(term) < 1e-20: break return result x = float(input().strip()) if x == 0: print("{0:.15f}".format(math.pi**2 / 6)) else: s = x + 1.0 result = trigamma(s) print("{0:.15f}".format(result))