#include<bits/stdc++.h> using namespace std; int a,tot; int main() { for(int i=1;i<=8;i++) { cin>>a; if(a==1) tot++; } cout<<tot; return 0; }