#include
using namespace std;
int suma(int mas[3][3]) {
int sum = 0;
for (int i = 0; i < 3; i++) {
for (int k = 0; k < 3; k++) {
if (mas[i][k] < 0) sum += mas[i][k];
}
}
return sum;
}
int main() {
int mas[3][3] = {}, sum = 0;
for (int i = 0; i < 3; i++) {
for (int k = 0; k < 3; k++) {
cin >> mas[i][k];
}
}
mas[1][2] += suma(mas);
system("Pause");
return 0;
}