#define PROB Problema2

#include <iostream>
#include <fstream>
#include<vector>
#include<queue>
#include<stack>
#include<cstring>
#include<map>
#include<unordered_map>

using namespace std;
typedef int var;
#define fin cin
#define fout cout

//ifstream fin("date.in");
//ofstream fout("date.out");

char number[12], sol1[12], sol2[12], sol[12];
unordered_map<string, bool> M;

bool check(char sol[12]) {
    if(sol[0] != '0') return false;
    if(sol[1] != '7') return false;

    string ssol(sol);
    if(M[ssol]) return false;
    M[ssol] = 1;
    return true;

}

int main()
{
    fin >> number;
    var nr = 0;
    for(var i=0; i<=9; i++) {
        var j;
        for(j=0; j<i; j++) {
            sol1[j] = number[j];
        }
        sol1[j] = 0;
        for(j=i; j<=8; j++) {
            sol2[j-i] = number[j];
        }
        sol2[j-i] = 0;


        for(char c='0'; c<='9'; c++) {
            memset(sol, 0, sizeof(sol));
            strcpy(sol, sol1);
            sol[strlen(sol)] = c;
            strcat(sol, sol2);
            if(check(sol))
                nr++;
        }
    }

    fout<<nr;
    return 0;
}