import java.io.*;
import java.util.*;

public class aplusb_sp_wa {

	BufferedReader br;
	PrintWriter out;
	StringTokenizer st;
	
	char[] reverse(char[] ch) {
		char[] res = new char[ch.length];
		for (int i = 0; i < ch.length; i++) {
			res[i] = ch[ch.length - i - 1];
		}
		return res;
	}
	
	int MOD = (int) (1e9 + 7);

	public void solve() throws IOException {
		char[] c = reverse(br.readLine().toCharArray());
		int n = c.length;
		for (int i = 0; i < n; i++) {
			c[i] = (char) (c[i] - '0');
		}
		int[][][][] d = new int[n][10][10][2];
		for (int i = 0; i <= c[0]; i++) {
			d[0][i][c[0] - i][0] = 1;
			d[0][c[0] - i][i][0] = 1;
		}
		for (int i = c[0] + 1; i < 10; i++) {
			d[0][i][10 + c[0] - i][1] = 1;
			d[0][10 + c[0] - i][i][1] = 1;
		}
		for (int i = 1; i < n; i++) {
			for (int j = 0; j < 10; j++) {
				for (int k = 0; k < 10; k++) {
					for (int p = 0; p < 2; p++) {
						if (j + k == (10 * p + c[i])) {
							for (int x = 0; x < 10; x++) {
								if (j == x) continue;
								for (int y = 0; y < 10; y++) {
									if (k == y) continue;
									d[i][j][k][p] = (d[i][j][k][p] + d[i - 1][x][y][0]) % MOD;
								}
							}
						}
						if (j + k == (10 * p + c[i] - 1)) {
							for (int x = 0; x < 10; x++) {
								if (j == x) continue;
								for (int y = 0; y < 10; y++) {
									if (k == y) continue;
									d[i][j][k][p] = (d[i][j][k][p] + d[i - 1][x][y][1]) % MOD;
								}
							}
						}
					}
				}
			}
		}
		int ans = 0;
		for (int i = 1; i < 10; i++) {
			for (int j = 1; j < 10; j++) {
				if (i + j == c[n - 1]) {
					ans = (ans + d[n - 1][i][j][0]) % MOD;
				}
			}
		}
		out.println(ans);
	}

	public void run() {
		try {
			br = new BufferedReader(new FileReader("aplusb.in"));
			out = new PrintWriter("aplusb.out");
			solve();
			out.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	public static void main(String[] args) {
		new aplusb_sp_wa().run();
	}
}
