import math def compute_S_alpha(alpha): sum_val = 0.0 j = 0 while True: x_j = alpha + j if x_j == 0: term = 1.0 else: term = (math.sin(x_j) / x_j) ** 2 # Check if the term is too small to contribute if sum_val == 0.0: sum_val += term j += 1 continue if term < 1e-16 * sum_val: break sum_val += term j += 1 # Add tail approximation: 0.5 / (alpha + j) tail = 0.5 / (alpha + j) sum_val += tail return sum_val def main(): x = float(input().strip()) if x.is_integer(): result = (math.pi + 1) / 2 else: m = math.floor(x) alpha = x - m sum_part = 0.0 for k in range(m): x_k = alpha + k if x_k == 0: term = 1.0 else: term = (math.sin(x_k) / x_k) ** 2 sum_part += term S_alpha = compute_S_alpha(alpha) result = S_alpha - sum_part print("{0:.20f}".format(result)) if __name__ == '__main__': main()