#include #include #include #include #include #include #include #include #include #include #include #include #include #include using namespace std; #define INF (1<<29) #define rep(i,n) for(int i=0;i<(int)(n);i++) #define all(v) v.begin(),v.end() #define uniq(v) v.erase(unique(all(v)),v.end()) #define indexOf(v,x) (find(all(v),x)-v.begin()) int main(){ int a[100],n; cin>>n; rep(i,n)cin>>a[i]; int s=accumulate(a,a+n,0); int ans=0; rep(i,n)if(a[i]*10<=s)ans+=30; cout<