#include <bits/stdc++.h>
using namespace std;
int arr[13][10] = {{0, 1, 2, 4, 5, 6, 10},   {2, 6, 10, 10, 10, 10, 10},
                   {0, 2, 3, 4, 5, 10, 10},  {0, 2, 3, 5, 6, 10, 10},
                   {1, 2, 3, 6, 10, 10, 10}, {0, 1, 3, 5, 6, 10, 10},
                   {0, 1, 3, 4, 5, 6, 10},   {0, 2, 6, 10, 10, 10, 10},
                   {0, 1, 2, 3, 4, 5, 6},    {0, 1, 2, 3, 5, 6, 10}};
bool ok(int a, int b) {
  int k;
  for (int i = (0); i < (7); i++) {
    k = arr[a][i];
    if (k == 10) continue;
    if (!binary_search(arr[b], arr[b] + 7, k)) {
      return 0;
    }
  }
  return 1;
}
int main(int argc, char const* argv[]) {
  int a, b, c;
  scanf("%d", &c);
  a = c / 10;
  b = c % 10;
  set<pair<int, int> > res;
  for (int i = (0); i < (10); i++) {
    if (!ok(a, i)) {
      continue;
    }
    for (int j = (0); j < (10); j++) {
      if (!ok(b, j)) {
        continue;
      }
      res.insert(make_pair(i, j));
    }
  }
  a = res.size();
  printf("%d\n", a);
  return 0;
}
