#include<bits/stdc++.h>
using namespace std;
int main()
{
	string a;
	int t=0;
	cin>>a;
	for(int i=0;i<a.size()-3;i++){
		string s(a,i,4);
		if(s=="ZONe") t++;
	}
	cout<<t;
	return 0;
}
/*COMPETITIVE PROGRAMMING C++ TEMPLATE */
 
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <string>
#include <cmath>
#include <iostream>
#include <stack>
#include <queue>
#include <climits>
#include <iomanip>
#include <cassert>
#include <functional>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp> 
 
#define all(x) x.begin(), x.end()
#define debug(x) cout << #x << " = " << x << "\n"
#define debug2(x, y) cout << #x << " = " << x << " " << #y << " " << y << "\n";
#define MOD 1000000007
 
const long double PI = 3.141592653589793236L;
 
typedef long long int ll;
typedef long double ld;
 
using namespace std;
using namespace __gnu_pbds;

// Refer to https://codeforces.com/blog/entry/11080
typedef tree<int, null_type, less<int>, rb_tree_tag, 
        tree_order_statistics_node_update> ordered_set; 

void solve() 
{
    int x;
    cin >> x;

    if(x % 100)
    {
        cout << 100 - (x % 100) << "\n";
    }
    else {
        cout << 100 << "\n";
    }

} 

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
 
    int T = 1;
    //cin >> T;

    while (T--)
    {
        solve();
    }
    
    return 0;
}


