#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <cstdlib>
#include <set>
#include <time.h>
#include <sstream>
#include <queue>
using namespace std;
using ll=long long;
void print(int *some_list,int many){
  cout << "[";
  for (int i=0;i<many;i++){
    cout << some_list[i] << ", ";
  }
  cout << "]" << "  要素数:" << many << endl;
}

string bit(int a,int base=2){
  int b;
  string s="";
  for(int i=0;a>0;i++){
    b=a%base;
    a-=b;
    a/=base;
    char num='0'+b;
    s.push_back(num);
  }
  reverse(s.begin(),s.end());
  return s;
}




int main(){
  ll ans=0,n;
  cin >> n;
  for(int i=0;i<n;i++){
    ll many;
    cin >> many;
    if(many>10) ans+=many-10;
  }
  cout << ans << endl;
}

#include <bits/stdc++.h>
#include <string>
using namespace std;
#define ll long long int
#define ld long double
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define mod 1000000007
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define fr(i,a,n) for(i=a;i<n;i++)
#define frn(i,a,n) for(i=a;i<=n;i++)
#define vll vector<ll>
#define pll pair<ll,ll>
#define vp vector<pll>
#define ub upper_bound
#define lb lower_bound
#define mem(x,y) memset(x,y,sizeof(x))
#define all(v) v.begin(),v.end()
#define qll queue<ll>
#define sll set<ll>
//(a/b)%mod = (a%mod*powermod(b,mod-2,mod))%mod
ll power(ll x,ll n)
{
    if(n==0)
        return 1;
    else if(n%2 == 0)        //n is even
        return power(x*x,n/2);
    else                    //n is odd
        return x*power(x*x,(n-1)/2);
}
int highestPowerof2(int n)
{
    int p = (int)log2(n);
    return (int)pow(2, p);
}
ll powermod(ll x, ll y, ll p)  
{  
    ll res = 1;
    x = x % p;
    if (x == 0) return 0;
    while (y > 0)  
    {
        if (y & 1)
            res = (res*x) % p;
        y = y>>1; 
        x = (x*x) % p;
    }
return res;
}
vector<string>s(70);
ll n;
ll dp[70][70];
ll trav(ll i,bool x,bool prev){
	if(i==n && prev) return 1;
	if(i==n) return 0;
	if(dp[i][prev]!=-1) return dp[i][prev];
	if(s[i]=="AND"){
		return dp[i][prev]=trav(i+1,true,prev&true)+trav(i+1,false,prev&false);
	}
	else{
		return dp[i][prev]=trav(i+1,true,prev|true)+trav(i+1,false,prev|false);
	}
}

int main(){
    memset(dp,-1,sizeof(dp));
	cin>>n;
	for(ll i=0;i<n;i++) cin>>s[i];
	ll sum=trav(0,true,true);
	memset(dp,-1,sizeof(dp));
	sum+=trav(0,false,false);
	cout<<sum<<endl;
	return 0;
}