#include <iostream>
using namespace std;

int main(int argc,char *argv[]){
    int i;
    cin >> i;
    string a;
    a = to_string(i);
    
    const char* s = a.c_str();


    int count = 0;


    for(int i = 0 ;i <= 2;i++){
        if('7' == s[i]){
            count ++;

        }
    
    }

    cout << count << endl;


    return 0;
}