//
// Created by INCOMPETENT CODER on 02-11-2020
//
#include "bits/stdc++.h"

using namespace std;
typedef long long int ll;
#define debug(...) cout<< " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] " ;

ll bin_search(ll a[], ll lb, ll ub, ll item) {
    while (lb <= ub) {
        ll mid = lb + (ub - lb) / 2;
        if (a[mid] == item) return mid;
        if (a[mid] > item) ub = mid - 1;
        else lb = mid + 1;
    }
    return -1;
}

ll power(ll x, ll y) {
    ll res = 1;
    while (y > 0) {
        if (y & 1)
            res = res * x;

        y = y >> 1;
        x = x * x;
    }
    return res;
}

ll powerp(ll x, ll y, ll p) {
    ll res = 1;
    x = x % p;
    if (x == 0) return 0;
    while (y > 0) {
        if (y & 1)
            res = (res * x) % p;

        y = y >> 1; // y = y/2
        x = (x * x) % p;
    }
    return res;
}

void solve() {
}

int main() {
    ll arr[124]={8,16,24,32,40,48,56,64,72,80,88,96,104,112,120,128,136,144,152,160,168,176,184,192,200,208,216,224,232,240,248,256,264,272,280,288,296,304,312,320,328,336,344,352,360,368,376,384,392,400,408,416,424,432,440,448,456,464,472,480,488,496,504,512,520,528,536,544,552,560,568,576,584,592,600,608,616,624,632,640,648,656,664,672,680,688,696,704,712,720,728,736,744,752,760,768,776,784,792,800,808,816,824,832,840,848,856,864,872,880,888,896,904,912,920,928,936,944,952,960,968,976,984,992};
    string kat[124];
    for(ll i=0;i<124;i++){
        kat[i]=to_string(arr[i]);
        if(kat[i].length()==1){
            kat[i]="00"+kat[i];
        }
        if(kat[i].length()==2){
            kat[i]="0"+kat[i];
        }
    }
    string s;
    cin>>s;
    if(s.length()==1){
        if((s[0]-'0')==8){
            cout<<"Yes";
            return 0;
        }
        else{
            cout<<"No";
            return 0;
        }
    }
    if(s.length()==2){
        ll x= stoi(s);
//        debug(x)
        reverse(s.begin(),s.end());
        ll gh=stoi(s);
//        debug(gh)
//        debug(bin_search(arr,0,123,x))
//        debug(bin_search(arr,0,123,gh))
        if((bin_search(arr,0,123,x)!=-1) || (bin_search(arr,0,123,gh)!=-1)){
            cout<<"Yes";
            return 0;

        }
        else{
            cout<<"No";
            return 0;
        }
    }
//    debug("dfsaf")
    map<ll,ll> temp;
    for(auto x:s){
        temp[x-'0']++;
    }
    ll flag=0;
    for(ll i=0;i<124;i++){
        ll flag1=0;
        ll freq[10]={0};
        for(auto g: kat[i]){
            freq[g-'0']++;
        }
        for(ll i=0;i<10;i++){
            if(freq[i]>0 && temp[i]< freq[i] ){
                flag1=1;
                break;
            }
        }
        if(flag1==0){
            cout<<"Yes";
            return 0;
        } else continue;
    }
    cout<<"No";

}
#include<bits/stdc++.h>

using   namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;

#define  all(v)       (v).begin(),(v).end()
#define  rall(v)      (v).rbegin(),(v).rend()
#define  pb           push_back  
#define  pob          pop_back
#define  eb           emplace_back
#define  ins          insert
#define  mp           make_pair
#define  ff           first
#define  ss           second
#define  pf           push_front
#define  bs           binary_search
#define  lb           lower_bound
#define  ub           upper_bound
#define  sz(a)        (ll)a.size()
#define  dec(x)       fixed<<setprecision(x)
#define  lcm(a,b)     (a*b/__gcd(a,b))

typedef  priority_queue<ll>  pq;
typedef  priority_queue<ll,vector<ll>,greater<ll> > pqmn;
typedef  pair<ll,ll> pll;
typedef  vector<ll> vll;
typedef  vector<pll> vpll;
typedef  vector<vector<ll> > vvll;
typedef  vector<string> vstr;
typedef  set<ll> sll;
typedef  set<pll> spll;
typedef  map<ll,ll> mll;

const    ll inf=LLONG_MAX;
const    ll mod=1e9+7;
const    ld pi=acos(-1);
const    ll N=100001;
                 
void solution()
{
    int n;
    cin>>n;
    cout<<100-n%100;
}

int main()
{
	//freopen("t","r",stdin);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll t;
    t=1;
    //cin>>t;
    while(t--){
        solution();
    }
    return 0;

}
