#include <bits/stdc++.h>
using namespace std;
int a[2001] = {6};
int c[10] = {6,2,5,5,4,5,6,3,7,6};
int get_num,num1,num2;
int main(void)
{
cin >> get_num;
for (int i = 1;i <= 2000;i++)
{
num2 = i;
while (num2 >= 1)
{
a[i] = a[i] + c[num2 % 10];
num2 /= 10;
}
}
num1 = 0;
for (int i = 0;i <= 1000;i++)
{
for (int j = 0;j <= 1000;j++)
{
if (get_num == a[i] + a[j] + a[i + j] + 4)
{
num1++;
}
}
}
cout << num1;
return 0;
}