#include <cstdio>
#include <cstring>
#include <iostream>
using namespace std;
int chan[10]={6,2,5,5,4,5,6,3,7,6};
int cnt(int n)
{
if (n==0) return 6;
int k=n;
int sum=0;
while (k!=0)
{
sum+=chan[k%10];
k=k/10;
}
return sum;
}
int main()
{
freopen("matches.in","r",stdin);
freopen("matches.out","w",stdout);
int n;
scanf("%d",&n);
if (n<10)
{
printf("0");
return 0;
}
n=n-4;
int time=0;
for(int a=0;a<=800;a++)
{
for(int b=0;b<=800;b++)
{
int k=a+b;
int o=cnt(a),p=cnt(b),q=cnt(k);
if (o+p+q==n)
time++;
}
}
printf("%d",time);
//system("pause");
return 0;
}