#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  bool arr[10][10];
  memset(arr, 0, sizeof arr);
  arr[0][0] = arr[0][8] = true;
  arr[1][0] = arr[1][1] = arr[1][3] = arr[1][4] = arr[1][7] = arr[1][8] =
      arr[1][9] = true;
  arr[2][2] = arr[2][8] = true;
  arr[3][3] = arr[3][8] = arr[3][9] = true;
  arr[4][4] = arr[4][8] = arr[4][9] = true;
  arr[5][5] = arr[5][6] = arr[5][8] = arr[5][9] = true;
  arr[6][6] = arr[6][8] = true;
  arr[7][0] = arr[7][3] = arr[7][7] = arr[7][8] = arr[7][9] = true;
  arr[8][8] = true;
  arr[9][8] = arr[9][9] = true;
  int n1, n2;
  cin >> n1;
  n2 = n1 % 10, n1 /= 10;
  cout << count(arr[n1], arr[n1] + 10, true) *
              count(arr[n2], arr[n2] + 10, true);
  return 0;
}
