#include<cstdio>
using namespace std;
int cost[10000]={6,2,5,5,4,5,6,3,7,6};
int sol = 0;
int main(){
freopen("matches.in","r",stdin);
freopen("matches.out","w",stdout);
int matches;
scanf("%d",&matches);
matches-=4;
for(int i = 10;i<10000;++i){
int n = i;
while(n!=0){
cost[i]+=cost[n%10];
n/=10;
}
}
for(int i = 0;i<5000;++i)
for(int j = 0;j<5000;++j){
if(cost[i]+cost[j]+cost[i+j]==matches)
sol++;
}
printf("%d",sol);
fclose(stdin);fclose(stdout);
return 0;
}