#include <bits/stdc++.h>
using namespace std;
int digits[10] = {1110111, 10010,   1011101, 1011011, 111010,
                  1101011, 1101111, 1010010, 1111111, 1111011};
int good1(int n, int x) {
  n = digits[n];
  x = digits[x];
  for (int i = 0; i < 7; i++) {
    if (x % 10 == 0 && n % 10 == 1) {
      return 0;
    }
    n /= 10;
    x /= 10;
  }
  return 1;
}
int good(int n, int x) {
  int n1 = n / 10;
  int n2 = n % 10;
  int x1 = x / 10;
  int x2 = x % 10;
  return good1(n1, x1) && good1(n2, x2);
}
int main() {
  int n;
  scanf("%d", &n);
  int cnt = 0;
  for (int i = 0; i < 100; i++) {
    cnt += good(n, i);
  }
  printf("%d\n", cnt);
}
