#include<bits/stdc++.h> using namespace std; int main(){ int max=0,n; cin>>n; while(n>0){ if(max<n%10){ max=n%10; } n/=10; } cout<<max; }