import java.io.*; import java.util.*; public class Main { static final int MOD = 1000000007; public static void main(String[] args) throws Exception { Scanner sc = new Scanner(); char[] values = sc.next().toCharArray(); int length = values.length; int[][] dp = new int[length + 1][100]; int current = values[0] - '0'; boolean isZero = false; for (int i = 1; i < values[0] - '0'; i++) { dp[1][i]++; } for (int i = 1; i < length; i++) { int v = values[i] - '0'; for (int j = 0; j < 100; j++) { if (dp[i][j] == 0) { continue; } for (int k = 1; k <= 9; k++) { dp[i + 1][j * k % 100] += dp[i][j]; dp[i + 1][j * k % 100] %= MOD; } } if (!isZero) { for (int j = 1; j < v; j++) { dp[i + 1][current * j % 100]++; dp[i + 1][current * j % 100] %= MOD; } isZero = (v == 0); current *= v; current %= 100; } for (int j = 1; j <= 9; j++) { dp[i + 1][j]++; dp[i + 1][j] %= MOD; } } if (!isZero) { dp[length][current]++; dp[length][current] %= MOD; } System.out.println(dp[length][0]); } } class Scanner { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); StringTokenizer st = new StringTokenizer(""); public Scanner() throws Exception { } public int nextInt() throws Exception { return Integer.parseInt(next()); } public long nextLong() throws Exception { return Long.parseLong(next()); } public double nextDouble() throws Exception { return Double.parseDouble(next()); } public String next() throws Exception { while (!st.hasMoreTokens()) { st = new StringTokenizer(br.readLine()); } return st.nextToken(); } }