#include <iostream>
using namespace std;
int main(){
int arr[4][4], s=0;
for (int i=0; i<4; ++i)
for (int j=0; j<4; ++j)
cin>>arr[i][j];
for (int i=0; i<4; ++i) s+=arr[3][i];
cout<<s;
}
#include <iostream>
using namespace std;
int main(){
int arr[4][4], s=0;
for (int i=0; i<4; ++i)
for (int j=0; j<4; ++j)
cin>>arr[i][j];
for (int i=0; i<4; ++i) s+=arr[3][i];
cout<<s;
}