#include <iostream>
#include<cmath>
using namespace std;
int main() {
int n[100],m,i,x,S=0;
cout<<"cate nr sunt";
cin>>m;
cout<<"introdu nr";
for (i=1;i<=m;i++){
cin>>n[i];
if (sqrt(n[i])==floor((sqrt(n[i])))){
while (n[i]!=0){
x=n[i]%10;
S=S+x;
n[i]=n[i]/10;
}
}
}
cout<<S;
}