#include <bits/stdc++.h>
using namespace std;
int ar[10] = {119, 18, 93, 91, 58, 107, 111, 82, 127, 123};
int main() {
  string s;
  getline(cin, s);
  int a = s[0] - '0';
  int res1 = 0;
  for (int i = 0; i < 128; i++) {
    if ((i & ar[a]) == 0) {
      for (int j = 0; j < 10; j++) {
        if (ar[j] == (i | ar[a])) {
          res1++;
          break;
        }
      }
    }
  }
  a = s[1] - '0';
  int res2 = 0;
  for (int i = 0; i < 128; i++) {
    if ((i & ar[a]) == 0) {
      for (int j = 0; j < 10; j++) {
        if (ar[j] == (i | ar[a])) {
          res2++;
          break;
        }
      }
    }
  }
  printf("%d\n", res1 * res2);
  return 0;
}
