#include using namespace std; typedef long long ll; typedef unsigned long long ull; typedef vector vi; typedef vector vl; typedef pair pii; typedef pair pll; #define REP(i, n) for(int i=0; i<(n); ++i) #define FOR(i, a, b) for(int i=(a); i<(b); ++i) #define FORR(i, a, b) for(int i=(b)-1; i>=(a); --i) #define DEBUG(x) cout<<#x<<": "<<(x)<<'\n' #define DEBUG_VEC(v) cout<<#v<<":";REP(i, v.size())cout<<' '< inline void CHMAX(T& a, const T b) {if(a inline void CHMIN(T& a, const T b) {if(a>b) a=b;} constexpr ll MOD=1000000007ll; // constexpr ll MOD=998244353ll; #define FIX(a) ((a)%MOD+MOD)%MOD const double EPS=1e-11; #define EQ0(x) (abs((x))sputn(d, len) != len) { dest.setstate(std::ios_base::badbit); } } return dest; } __int128 parse(string &s) { __int128 ret = 0; for (int i = 0; i < s.length(); i++) if ('0' <= s[i] && s[i] <= '9') ret = 10 * ret + s[i] - '0'; return ret; } int main() { ios::sync_with_stdio(false); cin.tie(0); // cout<>n; __int128 k=1; REP(i, n){ string p; cin>>p; __int128 x=parse(p); k*=x; } while(1){ int cnt=0; __int128 kk=k; __int128 tmp=0; while(kk>0){ tmp+=kk%10; kk/=10; ++cnt; } if(cnt<=1){ break; } k=tmp; } cout<