def saiki(n,A):

    if n == N:
        print(len(A))
        return

    alpha = list("abcdefghijklm")

    tmp = []

    for i in A:
        a = alpha.index(sorted(list(i))[-1])
        for j in range(a+2):
            tmp.append(i+alpha[j])
    
    saiki(n+1,tmp)

N = int(input())

saiki(1,["a"])