Go: package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
)

var scanner = bufio.NewScanner(os.Stdin)

func nextString() string {
	scanner.Scan()
	return scanner.Text()
}

func nextFloat64() (float64, error) {
	return strconv.ParseFloat(nextString(), 64)
}

func main() {
	scanner.Split(bufio.ScanWords)

	n := 5
	array := make([]float64, n)
	for i := 0; i < n; i++ {
		array[i], _ = nextFloat64()
	}

	// fmt.Println(array)
	fmt.Println(int(array[0] - math.Ceil(math.Max(array[1]/array[3], array[2]/array[4]))))
}

C++: #include<iostream>
using namespace std;
int main(){
  int day,mmax,jmax;
  int j,m,jd=0,md=0;
  cin>>day>>jmax>>mmax>>j>>m;
  while(1){
    jmax-=j;
    jd++;
    if(jmax<=0){
      break;
    }
  }while(1){
    mmax-=m;
    md++;
    if(mmax<=0){
      break;
    }
  }
  if(jd>=md){
    day-=jd;
  }if(jd<md){
    day-=md;
  }
  cout<<day<<endl;
  return 0;
}

C++: #include<bits/stdc++.h>
typedef long long ll;
using namespace std;
int main() {
	int a, b, c, d, e;
	cin >> a;
	cin >> b;
	cin >> c;
	cin >> d;
	cin >> e;
	cout << a - max((b + d - 1) / d,(c + e - 1) / e) << endl;
}

C++: #include <bits/stdc++.h>
using namespace std;

int main(){
	int l,a,b,c,d;
	cin>>l>>a>>b>>c>>d;
	int x = a/c + (a%c ? 1 : 0);
	int y = b/d + (b%d ? 1 : 0);
	cout<<l-max(x,y)<<endl;
}

C++: #include<stdio.h>
#define max(A,B) (A>B?A:B)
int l,a,b,c,d;
main(){scanf("%d%d%d%d%d",&l,&a,&b,&c,&d);printf("%d\n",l-max(a/c+!!(a%c),b/d+!!(b%d)));return 0;}

C++: #include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){
  int a,b,c,d,e;
  cin>>a>>b>>c>>d>>e;
  cout<<a-max((b-1)/d+1,(c-1)/e+1)<<endl;
}

C++: #include <bits/stdc++.h>
using namespace std;
// #define int long long
typedef long long ll;
typedef pair<int,int> pii;
#define ITR(v,c) for(auto v=begin(c);v!=end(c);v++)
#define FOR(v,a,n) for(int v=a;v<(int)(n);v++)
#define FORE(x,arr) for(auto &x:arr)
#define REP(v,n) FOR(v,0,n)
#define RREP(v,n) for(int v=(int)(n);v>=0;v--)
#define ALL(c) begin(c),end(c)
const int DX[4]={0,1,0,-1}, DY[4]={-1,0,1,0};
const int INF = 1e9;
const ll INFLL = 1e18;
template<class T,class U>ostream&operator<<(ostream &os,const pair<T,U> &p){
    os<<"("<<p.first<<","<<p.second<<")";return os;}
template<class T>ostream&operator<<(ostream &os,const vector<T> &v){
    ITR(i,v)os<<*i<<(i==end(v)-1?"":" ");return os;}
//------------------------------------------------------------------------------

signed main() {
    double L,A,B,C,D;
    cin>>L>>A>>B>>C>>D;
    cout<<L-max(ceil(A/C),ceil(B/D))<<endl;
    return 0;
}

C++: #include<iostream>
#include<algorithm>
using namespace std;

int main(){
  int l,a,b,c,d;
  cin >> l >> a >> b >> c >> d;
  cout << l - max((a+c-1)/c,(b+d-1)/d) << endl;
}

C++: #include<stdio.h>
int main(void)
{
    int A=0, B=0, C=0, D=0, L = 0, a=0, b=0;
    scanf("%d", &L);
    scanf("%d %d", &A, &B);
    scanf("%d %d", &C, &D);
    A = A / C;
    a = A%C;
    if (a != 0) {
        A = A + 1;
    }
    B = B / D;
    b = B%D;
    if (b != 0) {
        B = B;
    }
    if (A > B) {
        L = L - A;
    }
    else {
        L = L - B;
    }
    if (L <= 0) {
        L = 1;
    }
    printf("%d\n", L);
    return 0;
}

C++: #include<stdio.h>

int main(){

int L,A,B,C,D;
int t1,t2;
scanf("%d",&L);
scanf("%d",&A);
scanf("%d",&B);
scanf("%d",&C);
scanf("%d",&D);

t1=A/C;if(A%C!=0)t1++;
t2=B/D;if(B%D!=0)t2++;

if(t2>t1)t1=t2;

L=L-t1;
printf("%d\n",t1);
return 0;
}

C++: #include <iostream>
#define MAX(x,y) (x>y?x:y)
using namespace std;

int main(){
	int l,a,b,c,d,day1,day2;

	cin>>l>>a>>b>>c>>d;

	day1=(a%c==0?a/c:a/c+1);
	day2=(b%d==0?b/d:b/d+1);

	cout<<l-MAX(day1,day2)<<endl;

	return 0;
}

C++: #include <stdio.h>
#include <algorithm>
using namespace std;

int main(){
	int huyu;
	int japanese;
	int math;
	int st_jap;
	int st_math;
	int jap_ans = 0;
	int mat_ans = 0;
	scanf("%d%d%d%d%d", &huyu, &japanese, &math, &st_jap, &st_math);

	while (1){
		if (japanese <= 0) break;
		japanese -= st_jap;
		jap_ans++;
	}
	while (1){
		if (math <= 0) break;
		math -= st_math;
		mat_ans++;
	}
	printf("%d\n", huyu - max(jap_ans, mat_ans));
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <map>
#include <string>
#include <queue>
#include <stack>
#include <math.h>
#include <cmath>
#include <numeric>
#include <iomanip>


#define log(x) cout<<x<<endl
#define pb push_back
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
typedef long long lint;
using namespace std;


// <<fixed<<setprecision(6)<<


int gcd(lint x, lint y){
  return y==0 ? x:gcd(y,x % y);
}


int Combination(int n, int r){
  int num = 1;
  for(int i = 1; i <= r; i++){
    num = num * (n - i + 1) / i;
  }
  return num;
}


int main(){
  int n,a,b,c,d,r1,r2;
  r1=1;
  r2=1;
  cin>>n>>a>>b>>c>>d;
  for(int i=c;i<a;i=i+c) {
    r1++;
  }
  for(int i=d;i<b;i=i+d) {
    r2++;
  }
  cout<<n-max(r1,r2)<<endl;
}

C++: #include <cstdio>
#include <cstdlib>
/*
forテ」ツδォテ」ツδシテ」ツδ療」ツつжhileテ」ツδォテ」ツδシテ」ツδ療」ツつ津、ツスツソテ」ツつ湘」ツ?ェテ」ツ??
ifテ」ツ?ィテ・ツ崢崚・ツ可?ヲツシツ氾ァツョツ療」ツ?ョテ」ツ?ソテ」ツ?ョテヲツ鳴ケテヲツウツ?
*/


int main(void){

	int L, A, B, C, D;
	// char ;

	scanf("%d %d %d %d %d", &L, &A, &B, &C, &D);

	int hoge = (A / C);
	int huga = (B / D);
	if (hoge * C != A) hoge++;
	if (huga * D != B) huga++;
	int day = hoge;
	if (hoge < huga) day = huga;

	printf("%d\n", L - day);

	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <cstring>
#include <cctype>
#include <cmath>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <list>
#include <stdio.h>
#include <string.h>
#include <cstdlib>
#include <math.h>
#include <bitset>
#define INF 2000000000
using namespace std;
int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};
#define ll long long
#define PL pair<long long, long long>
#define P pair<int,int>
#define mk make_pair
#define en endl;
#define WHITE 0
#define BLACK 2
#define GRAY 1
#define RE return 0;
#define HERE cout<<"    "<<"HERE"<<en

int main(){
  int l,a,b,c,d;
  cin>>l>>a>>b>>c>>d;
  
  int m,j;
  if(a%c) m=a/c+1;
  else m=a/c;
  if(b%d) j=b/d+1;
  else j=b/d;
  int l1=max(m,j);
  
  cout<<l-l1<<en
}

C++: //#include <bits/stdc++.h>


#include <vector>
#include <iostream>
#include <algorithm>
#include <string>
#include <queue>
#include <functional>
#include <sys/timeb.h>
#include <fstream>

using namespace std;

#define repr(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repr(i,0,n)
#define reprrev(i,a,b) for(int i=(int)(b)-1;i>=(int)(a);i--)
#define reprev(i,n) reprrev(i,0,n)
#define repi(itr,ds) for(auto itr=ds.begin();itr!=ds.end();itr++)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define mp make_pair
#define mt make_tuple
#define INF 1050000000
#define INFL 1100000000000000000LL
#define EPS (1e-10)
#define MOD 1000000007
#define PI 3.1415926536
#define RMAX 4294967295

typedef vector<int> vi;


int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);

	int N;
	cin >> N;
	vi s;
	int ans = 0;
	rep(i, N) {
		int tmp;
		cin >> tmp;
		s.push_back(tmp);
		ans += tmp;
	}

	if (ans % 10 != 0) {
		cout << ans << endl;
		return 0;
	}

	sort(all(s));

	bool flag = false;
	rep(i, N) {
		if (s[i] % 10 != 0) {
			ans -= s[i];
			flag = true;
			break;
		}
	}
	if (flag) {
		cout << ans << endl;
	}
	else {
		cout << "0" << endl;
	}
	

	return 0;
}