#include <bits/stdc++.h>
using namespace std;
string val[10];
bool ok(int a, int b) {
  for (int i = 0; i < 7; ++i)
    if (val[a][i] < val[b][i]) return false;
  return true;
}
int main() {
  val[0] = "1110111";
  val[1] = "0010010";
  val[2] = "1011101";
  val[3] = "1011011";
  val[4] = "0111010";
  val[5] = "1101011";
  val[6] = "1101111";
  val[7] = "1010010";
  val[8] = "1111111";
  val[9] = "1111011";
  string n;
  cin >> n;
  int a = n[0] - '0', b = n[1] - '0', ans = 0;
  for (int i = 0; i <= 99; ++i) {
    ans += ok(i / 10, a) && ok(i % 10, b);
  }
  cout << ans << '\n';
}
