//Bai 1
#include<bits/stdc++.h>
using namespace std;
#define el "\n"
#define ll long long
#define ull unsigned long long
#define se second
#define fi first
#define be begin
#define en end
#define Faster cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
void Run(int n, int a[])
{
ll ans = 0;
for(int i = 0; i < n; i++)
{
cin >> a[i];
if(a[i] % 5 == 0) ans += 1ll*a[i];
}
cout << ans;
}
int main()
{
Faster;
int n; cin >> n;
int a[n];
Run(n, a);
return 0;
}
Ly9CYWkgMQoKI2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKI2RlZmluZSBlbCAiXG4iCiNkZWZpbmUgbGwgbG9uZyBsb25nCiNkZWZpbmUgdWxsIHVuc2lnbmVkIGxvbmcgbG9uZwojZGVmaW5lIHNlIHNlY29uZAojZGVmaW5lIGZpIGZpcnN0CiNkZWZpbmUgYmUgYmVnaW4KI2RlZmluZSBlbiBlbmQKI2RlZmluZSBGYXN0ZXIgY2luLnRpZSgwKTsgY291dC50aWUoMCk7IGlvc19iYXNlOjpzeW5jX3dpdGhfc3RkaW8oMCk7CnZvaWQgUnVuKGludCBuLCBpbnQgYVtdKQp7CiAgICBsbCBhbnMgPSAwOwogICAgZm9yKGludCBpID0gMDsgaSA8IG47IGkrKykKICAgIHsKICAgICAgICBjaW4gPj4gYVtpXTsKICAgICAgICBpZihhW2ldICUgNSA9PSAwKSBhbnMgKz0gMWxsKmFbaV07CiAgICB9CiAgICBjb3V0IDw8IGFuczsKfQppbnQgbWFpbigpCnsKICAgIEZhc3RlcjsKICAgIGludCBuOyBjaW4gPj4gbjsKICAgIGludCBhW25dOwogICAgUnVuKG4sIGEpOwogICAgcmV0dXJuIDA7Cn0KCg==