#include <iostream>
#include <cstdio>
using namespace std;
string s;
int read(){
	int x = 0;
	char c = getchar();
	while(c < '0' || c > '9') c = getchar();
	while(c >= '0' && c <= '9') x = x * 10 + (c ^ 48),c = getchar();
	return x;
}
int main(){
	cin >> s;
	for(int i = 0; i < s.size(); i ++){
		if(i % 2 && s[i] > 'Z' || (i % 2 == 0) && s[i] <= 'Z'){
			printf("No\n");
			return 0;
		}
	}
	printf("Yes\n");
	return 0;
}
#include <bits/stdc++.h>
using namespace std;


bool has_seven(int x, int b) {
    while (x > 0) {
        if (x % b == 7) return true;
        x /= b;
    }
    return false;
}

int main() {
    int N; cin >> N;
    
    int cnt = 0;
    for (int n = 1; n <= N; n++) {
        if (has_seven(n, 10) || has_seven(n, 8)) {
            cnt++;
        }
    }
    cout << N - cnt << endl;
}
