#include <iostream>
using namespace std;
int N, summa;
int main()
{
int massiv[10];
cin >> N;
for (int i= 0; i< 10 ; i++)
cin >> a[i] ;
if (a[i] % N == 0)
summa = summa + a[i];
}
cout << summa;
return 0;
#include <iostream>
using namespace std;
int N, summa;
int main()
{
int massiv[10];
cin >> N;
for (int i= 0; i< 10 ; i++)
{
cin >> a[i] ;
if (a[i] % N == 0)
summa = summa + a[i];
}
cout << summa;
return 0;
}