#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define Rep(i,j,n) for(int i = j; i < (int)(n); i++)
using Graph = vector<vector<int>>;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

int main(){
    int n; cin >> n;
    int ans = 0;
    rep(i,n){
        int a; cin >> a;
        a -= 10;
        if(a >= 0) ans += a;
    }
    cout << ans << endl;
    return 0;
}
/*
start of cp 3.0BETA
NEW-BETA-LADDER
https://codeforces.com/problemset/page/1?tags=1800-1800
DEAD PERSON CODING
*/
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define MOD 1000000007
#define int long long int
#define pii pair<int,int>
#define vi vector<int>
#define vii vector<pii>
#define graph vector<vector<int>>
#define print(s) for(auto it:s) cout<<it<<" "
#define print2(s) for(auto it:s) cout<<it.fi<<" : "<<it.se
#define uset unordered_set
#define maxheap priority_queue<int>
#define minheap priority_queue<int,vi,greater<int>>
#define ln cout<<'\n'
#define space cout<<" "
#define len(x) x.size()
#define bits(x) __builtin_popcount(x)
void fileio()
{
    #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif
}
graph g;


int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    fileio();
    int n,m;
    cin>>n>>m;
    int o=0,e=0;
    for(int i=0;i<n;i++){
        string x;
        cin>>x;
        int ct=0;
        for(int j=0;j<m;j++){
            ct+=(x[j]=='1');
        }
        if(ct&1)o++;
        else e++;
    }
    cout<<o*e;
    return 0;
}

        