#include int keta(int N){ int i=0; while(N>0){ N=N/10; i++; } return i; } int main(){ int dt,dv,sum=0,data[5],i; for(i=0;i<5;i++) scanf("%d",&data[i]); for(i=0;i<5;i++){ dt=data[i]%3; dv=data[i]%5; if(dt == 0 && dv == 0) sum += 8; if(dt == 0 && dv != 0) sum += 4; if(dt != 0 && dv == 0) sum += 4; if(dt != 0 && dv != 0) sum += keta(data[i]); } printf("%d",sum); }