import java.util.*; public class Main { static int[] next = new int[]{0, 1, 2, 4, 5, 10, 20, 25, 50, 100}; static final int MOD = 1000000007; public static void main (String[] args) { Scanner sc = new Scanner(System.in); char[] arr = sc.next().toCharArray(); int length = arr.length; int size = next.length; int[][] dp = new int[length][size]; for (int i = 1; i < arr[0] - '0'; i++) { dp[0][getNum(i)]++; } int base = getNum(arr[0] - '0'); for (int i = 1; i < length; i++) { int x = arr[i] - '0'; for (int j = 1; j < x; j++) { dp[i][getNum(next[base] * j)]++; } for (int j = 1; j < 10; j++) { dp[i][getNum(j)]++; } base = getNum(next[base] * x); for (int j = 1; j < size; j++) { for (int k = 1; k < 10; k++) { int idx = getNum(next[j] * k); dp[i][idx] += dp[i - 1][j]; dp[i][idx] %= MOD; } } } dp[length - 1][base]++; System.out.println(dp[length - 1][size - 1]); } static int getNum(int x) { if (x == 0) { return 0; } for (int i = next.length - 1; i > 0; i--) { if (x % next[i] == 0) { return i; } } return 0; } }