const
  M = 1000000007;
  maxl = 100000;
var
  d : array[1..maxl, 0..9, 0..9, 0..1] of longint;
  i, j, k, p, x, y, ans, n : longint;
  ch : string;
  c : array[1..maxl] of integer;
begin
  reset(input, 'aplusb.in');
  rewrite(output, 'aplusb.out');
  readln(ch);
  n := length(ch);
  for i := 1 to n do begin
    c[i] := ord(ch[n - i + 1]) - ord('0');
  end;
  for i := 0 to c[1] do begin
    d[1][i][c[1] - i][0] := 1;
    d[1][c[1] - i][i][0] := 1;
  end;
  for i := c[1] + 1 to 9 do begin
    d[1][i][10 + c[1] - i][1] := 1;
    d[1][10 + c[1] - i][i][1] := 1;
  end;
  for k := 2 to n do begin
    for i := 0 to 9 do begin
      for j := 0 to 9 do begin
        for p := 0 to 1 do begin
          if (i + j = (10 * p + c[k])) then begin
            for x := 0 to 9 do begin
              if (i = x) then continue;
              for y := 0 to 9 do begin
                if (j = y) then continue;
                d[k][i][j][p] := (d[k][i][j][p] + d[k - 1][x][y][0]) mod M;
              end;
            end;
          end;

          if (i + j = (10 * p + c[k] - 1)) then begin
            for x := 0 to 9 do begin
              if (i = x) then continue;
              for y := 0 to 9 do begin
                if (j = y) then continue;
                d[k][i][j][p] := (d[k][i][j][p] + d[k - 1][x][y][1]) mod M;
              end;
            end;
          end;
        end;
      end;
    end;
  end;
  ans := 0;
  for i := 1 to 9 do begin
    for j := 1 to 9 do begin
      ans := (ans + d[n][i][j][0]) mod M;
    end;
  end;
  writeln(ans);
end.