#include <bits/stdc++.h>
using namespace std;
const double EPS = 10e-12;
int n, n1, n2;
int dig[10] = {
    (1 << (1)) | (1 << (2)) | (1 << (3)) | (1 << (5)) | (1 << (6)) | (1 << (7)),
    (1 << (3)) | (1 << (6)),
    (1 << (1)) | (1 << (3)) | (1 << (4)) | (1 << (5)) | (1 << (7)),
    (1 << (1)) | (1 << (3)) | (1 << (4)) | (1 << (6)) | (1 << (7)),
    (1 << (2)) | (1 << (3)) | (1 << (4)) | (1 << (6)),
    (1 << (1)) | (1 << (2)) | (1 << (4)) | (1 << (6)) | (1 << (7)),
    (1 << (1)) | (1 << (2)) | (1 << (5)) | (1 << (4)) | (1 << (6)) | (1 << (7)),
    (1 << (1)) | (1 << (3)) | (1 << (6)),
    (1 << (1)) | (1 << (2)) | (1 << (3)) | (1 << (4)) | (1 << (5)) |
        (1 << (6)) | (1 << (7)),
    (1 << (1)) | (1 << (2)) | (1 << (3)) | (1 << (4)) | (1 << (6)) | (1 << (7)),
};
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  n1 = n / 10;
  n2 = n % 10;
  int a, b;
  a = b = 0;
  for (int i = 0; i < 10; i++) {
    if (((dig[n1]) & dig[i]) == dig[n1]) {
      a++;
    }
    if (((dig[n2]) & dig[i]) == dig[n2]) {
      b++;
    }
  }
  cout << a * b << '\n';
}
