#include int main() { int a[5],i,ans; for(i = 0;i < 5;i++){ scanf("%d",&a[i]); } ans = 0; for(i = 0;i < 5;i++){ if(a[i] % 15 == 0){ ans += 8; }else if(a[i] % 3 == 0 || a[i] % 5 == 0){ ans += 4; }else{ do{ a[i] = a[i] / 10; ans += 1; }while(a[i] != 0); } } printf("%d\n",ans); return(0); }