#include <iostream>
#include <cmath>
using namespace std;
signed main() {
int n, _minDigit = 10;
cin >> n;
n = abs(n);
while (n > 0)
{
if (n % 10 < _minDigit)
_minDigit = n % 10;
n /= 10;
}
cout << _minDigit;
return 0;
#include <iostream>
#include <cmath>
using namespace std;
signed main() {
int n, _minDigit = 10;
cin >> n;
n = abs(n);
while (n > 0)
{
if (n % 10 < _minDigit)
_minDigit = n % 10;
n /= 10;
}
cout << _minDigit;
return 0;
}