#include using namespace std; signed main(){ int N; cin >> N; vector< string > A( N ); for( int i = 0; i < N; ++i ) cin >> A[ i ]; long long ans = 0x3f3f3f3f3f3f3f3fLL; for( int i = 0; i < N; ++i ) ans = min( ans, stoll( A[ i ], nullptr, 0 ) ); cout << ans << endl; return 0; }