#include using namespace std; #define REP(i,m,n) for(int i=(m);i<(n);i++) #define rep(i,n) REP(i,0,n) #define pb push_back #define mp make_pair #define all(c) (c).begin(),(c).end() #define rall(c) (c).rbegin(),(c).rend() #define double long double typedef long long ll; typedef pair pii; typedef pair pll; const ll inf=1e9+7; const ll mod=998244353; int main(){ ll n;cin>>n; ll sum=0; ll p; rep(i,n){ cin>>p; sum+=p; } ll ans=0; while(sum){ ans+=sum%10; sum/=10; } cout<