//丹阳新区实小路彦
include [HTML_REMOVED]
using namespace std;
int d[11] = {6, 2, 5, 5, 4, 5, 6, 3, 7, 6}, m, n, ans;
int main()
{
cin >> m;
m -= 4;
for(int a = 0; a <= 1111; a){
n = m;
if(a == 0) n -= d[0];
else
{
int t = a;
while(t)
{
n -= d[t % 10];
if(n < 0) break;
t /= 10;
}
}
for(int b = 0; b <= 1111; b)
{
int nn = n;
if(b == 0) nn -= d[0];
else
{
int t = b;
while(t)
{
nn -= d[t % 10];
if(nn < 0) break;
t /= 10;
}
}
int c = a + b;
if(c == 0) nn -= d[0];
else
{
int t = c;
while(t)
{
nn -= d[t % 10];
if(nn < 0) break;
t /= 10;
}
}
if(nn == 0) ans++;
}
}
cout << ans << endl;
return 0;
}