K = int(input())
note = [0] * (K + 1)

def E(x):
    
    if x < 1:
        return 0
    
    elif note[x] == 0:
        note[x] = (E(x - 1) + E(x - 2) + E(x - 3) + E(x - 4) + E(x - 5) + E(x - 6)) / 6 + 1
        
    return note[x]
    
print(E(K))