import sys; input = sys.stdin.buffer.readline sys.setrecursionlimit(10**7) from collections import defaultdict mod = 10 ** 9 + 7; INF = float("inf") def getlist(): return list(map(int, input().split())) import numpy as np def matrixPow(A, n, N): B = np.identity(N, dtype = np.int) while n > 0: if n & 1 == 1: B = (A @ B) % mod A = (A @ A) % mod n >>= 1 return B #処理内容 def main(): N = int(input()) A = np.full((10, 10), 1, dtype = np.int) for i in range(10): for j in range(i): A[i, j] = 0 pre = matrixPow(A, N - 1, 10) B = np.full((10, 1), 1, dtype = np.int) pre = pre @ B ans = sum(pre) print(ans[0] % mod) if __name__ == '__main__': main()