#include <iostream>
using namespace std;
/*
Declarăm și citim variabila “a”.
Declaram variabila “highestDigit”, “firstDigit” pe care o initializam cu prima cifra a numărului “a”, “secondDigit” pe care o initializam cu a doua cifra a numărului “a” și “thirdDigit” pe care o initializam cu a treia cifră a numărului “a”.
Cu ajutorul unei structuri decizionale verificam urmatoarele:
Daca “firstDigit” este mai mare sau egal cu “secondDigit” si daca “secondDigit” este mai mare sau egal cu “thirdDigit”:
“highestDigit” va lua valoarea lui “firstDigit”.
Altfel daca “firstDigit” mai mic sau egal cu “secondDigit” si “secondDigit” mai mare sau egal cu “thirdDigit”:
“highestDigit” va lua valoarea lui “secondDigit”.
Altfel daca “firstDigit” mai mic sau egal cu “secondDigit” si “secondDigit” mai mic sau egal cu “thirdDigit”:
“highestDigit” va lua valoarea lui “thirdDigit”.
Altfel daca “firstDigit” mai mare sau egal cu “secondDigit” si “secondDigit” mai mic sau egal cu “thirdDigit” si “thirdDigit” mai mic sau egal cu “firstDigit”:
“highestDigit” va lua valoarea lui “firstDigit”.
Altfel daca “firstDigit” mai mare sau egal cu “secondDigit” si “secondDigit” mai mic sau egal cu “thirdDigit” si “thirdDigit” mai mare sau egal cu “firstDigit”:
“highestDigit” va lua valoarea lui “thirdDigit”.
*/
const int TEN = 10;
int main() {
int a;
cin >> a;
int highestDigit, firstDigit = a / TEN / TEN, secondDigit = a / TEN % TEN,
thirdDigit = a % TEN;
if (firstDigit >= secondDigit && secondDigit >= thirdDigit) {
highestDigit = firstDigit;
} else if (firstDigit <= secondDigit && secondDigit >= thirdDigit) {
highestDigit = secondDigit;
} else if (firstDigit <= secondDigit && secondDigit <= thirdDigit) {
highestDigit = thirdDigit;
} else if (firstDigit >= secondDigit && secondDigit <= thirdDigit && firstDigit >= thirdDigit) {
highestDigit = firstDigit;
} else if (firstDigit >= secondDigit && secondDigit <= thirdDigit && firstDigit <= thirdDigit) {
highestDigit = thirdDigit;
}
cout << highestDigit;
return 0;
}