#include <bits/stdc++.h>
using namespace std;
const int num[] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6};
int dp[2000];
int solve(int k) {
if(dp[k]) return dp[k];
if(k < 10) return dp[k] = num[k];
else if(k<100){
int a = k/10;
int b = k%10;
return dp[k] = num[a] + num[b];
}
else {
int a = k/100;
int b = k%10;
int c = k/10%10;
return dp[k] = num[a] + num[b] + num[c];
}
}
int main() {
memset(dp, 0, sizeof(dp));
int n;
cin >> n;
n-=4;
int cnt = 0;
for(int i = 0; i <= 999; i++) {
for(int j = 0; j <= 999; j++) {
int k = i + j;
if(n == solve(k) + solve(i) + solve(j)) cnt++;
}
}
cout << cnt;
}