#include <bits/stdc++.h>
using namespace std;
const int N = 123456;
int main() {
  int n;
  cin >> n;
  int a[10][10] = {0};
  a[0][0] = 1;
  a[0][8] = 1;
  a[1][0] = 1;
  a[1][1] = 1;
  a[1][3] = 1;
  a[1][4] = 1;
  a[1][7] = 1;
  a[1][8] = 1;
  a[1][9] = 1;
  a[2][2] = 1;
  a[2][8] = 1;
  a[3][3] = 1;
  a[3][8] = 1;
  a[3][9] = 1;
  a[4][4] = 1;
  a[4][8] = 1;
  a[4][9] = 1;
  a[5][5] = 1;
  a[5][6] = 1;
  a[5][8] = 1;
  a[5][9] = 1;
  a[6][6] = 1;
  a[6][8] = 1;
  a[7][0] = 1;
  a[7][3] = 1;
  a[7][7] = 1;
  a[7][9] = 1;
  a[7][8] = 1;
  a[8][8] = 1;
  a[9][8] = 1;
  a[9][9] = 1;
  int m = 0, p = 0;
  for (int i = 0; i < 10; i++) {
    if (a[n / 10][i] == 1) m++;
    if (a[n % 10][i] == 1) p++;
  }
  cout << (m * p);
  return 0;
}
