#include using namespace std; typedef long long ll; int main(){ int n;cin >> n; vector p(n); ll k=1; for(int i=0;i> p[i]; if(p[i]%9==0){ k*=9; k%=9; } else{ k*=(p[i]%9); k%=9; } } cout << k << endl; }