n = int(input()) if n < 6: print(0) else: print(1 - 6*pow(5/6, n)+15*pow(2/3, n)-20*pow(1/2, n)+15*pow(1/3, n)-6*pow(1/6, n))