from collections import defaultdict, Counter

from itertools import product, groupby, count, permutations, combinations

from math import pi, sqrt

from collections import deque

from bisect import bisect, bisect_left, bisect_right

from string import ascii_lowercase

from functools import lru_cache

import sys

sys.setrecursionlimit(10000)

INF = float("inf")

YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"





def main():

    a = eval(input())

    b = eval(input())

    c = eval(input())

    print((a[0] + b[1] + c[2]))





if __name__ == '__main__':

    main()

#!/usr/bin/python3



from collections import defaultdict, Counter

from itertools import product, groupby, count, permutations, combinations

from math import pi, sqrt

from collections import deque

from bisect import bisect, bisect_left, bisect_right

from string import ascii_lowercase

from functools import lru_cache

import sys

sys.setrecursionlimit(10000)

INF = float("inf")

YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"

dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]





def inside(y, x, H, W):

    return 0 <= y < H and 0 <= x < W





def main():

    C = []

    for i in range(3):

        C.append(eval(input()))

    print((C[0][0] + C[1][1] + C[2][2]))



if __name__ == '__main__':

    main()

from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys

sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"


def main():
    a = eval(input())
    b = eval(input())
    c = eval(input())
    print((a[0] + b[1] + c[2]))


if __name__ == "__main__":
    main()

#!/usr/bin/python3
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys

sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def main():
    C = []
    for i in range(3):
        C.append(eval(input()))
    print((C[0][0] + C[1][1] + C[2][2]))


if __name__ == "__main__":
    main()

+#!/usr/bin/python3 +dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0] + + +def inside(y, x, H, W): +    return 0 <= y < H and 0 <= x < W -    a = eval(input()) -    b = eval(input()) -    c = eval(input()) -    print((a[0] + b[1] + c[2])) +    C = [] +    for i in range(3): +        C.append(eval(input())) +    print((C[0][0] + C[1][1] + C[2][2]))