#include using namespace std; using ll = long long; int main() { int n;cin >>n; vector p(n); ll mult =1; for(int i=0;i> p[i]; mult*=p[i]; } ll dig=0; ll sum=0; while(mult>9){ while(mult>0){ dig=mult%10; sum += dig; mult/=10; } mult=sum; } cout << mult <