import sys

sys.stdin = open('aplusb.in')
sys.stdout = open('aplusb.out', 'w')

MOD = 10**9 + 7

c = input()
    
# a = 1234...  
# b = 9876...  
#s[k][i][j][p] - number of combination for c[-k:] + 10**k * p with first digit of a = i and first digit of b = j
    
s = [[[[0, 0] for i in range(10)] for j in range(10) ] for k in range(len(c) + 1)]
for i in range(int(c[-1]) + 1):
    s[1][i][int(c[-1]) - i][0] = 1
for i in range(int(c[-1]) + 1, 10):
    s[1][i][10 + int(c[-1]) - i][1] = 1

for k in range(2, len(c) + 1):
    for i in range(10):
        for j in range(10):
            for p in range(2):
                if i + j == int(c[-k]) + 10 * p:
                         for x in range(10):
                              for y in range(10):
                                  s[k][i][j][p] += s[k - 1][x][y][0] if x != i and y != j else 0 
                                  s[k][i][j][p] %= MOD
                elif i + j == int(c[-k]) + 10 * p - 1:
                         for x in range(10):
                              for y in range(10):
                                  s[k][i][j][p] += s[k - 1][x][y][1] if x != i and y != j else 0                
                                  s[k][i][j][p] %= MOD

#for k in range(1, len(c) + 1):
#    for i in range(10):
#        for j in range(10):
#            print(s[k][i][j][0], end=' ')
#        print()
#    print()

print(sum([sum([s[len(c)][i][j][0] for i in range(1, 10)]) for j in range(1, 10)]) % MOD)                
