#include <stdio.h>
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <cstring>
#include <string>
#include <algorithm>

#define maxdim 200005

using namespace std;

string s;

inline bool ok(const string &s) {
	return s[0] == '0' && s[1] == '7';
}
vector<string> sols;

int main() {

	#ifndef ONLINE_JUDGE
	freopen("p.in", "r", stdin);
	freopen("p.out", "w", stdout);
	#endif

	cin >> s; string a; int sol = 0;
	for (int i = 0; i <= 10; ++i) {

		for (int d = 0; d < 10; ++d) {
			string s2 = a;
			s2 += (d + '0');
			s2 += s;
			// cout << s2 << "\n";
			if (ok(s2)) {
				++sol;
				sols.push_back(s2);
			}
		}

		if (!s.empty()) {
			a += s[0];
			s = s.substr(1);
		}
	}

	sort(sols.begin(), sols.end());
	sol = !sols.empty();
	for (int i = 1; i < (int)sols.size(); ++i) {
		sol += (sols[i] != sols[i-1]);
	}
	cout << sol << "\n";

	return 0;
}