#include <bits/stdc++.h>
using namespace std;

bool tong(int n){
	int sum = 0;
	while(n > 0){
		sum += n % 10;
		n /= 10;
	}
	return (sum % 10 == 9);
}

int32_t main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	
	int n;
	cin >> n;
	cout << tong(n);
	
	return 0;
}