#include <bits/stdc++.h>
using namespace std;
int con[10][10] = {1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
                   0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0,
                   0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0,
                   0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0,
                   1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1};
int main() {
  ios::sync_with_stdio(false);
  int n, ans = 0;
  cin >> n;
  for (int i = 0; i < 100; i++) {
    if (con[i % 10][n % 10] == 1 && con[i / 10][n / 10] == 1) ans++;
  }
  cout << ans;
}
