function main(input) {
  input=input.trim();
  const a = parseInt(input.split("\n")[0].split("")[0], 10);
  const b = parseInt(input.split("\n")[1].split("")[1], 10);
  const c = parseInt(input.split("\n")[2].split("")[2], 10);



  console.log(a+b+c);

}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

