Олимпиадный тренинг

Задача 37091. 12.39


There are N rows in the auditorium, each of which has M seats (seats). Information about tickets sold is stored in a two-dimensional array, row numbers correspond to row numbers, and column numbers correspond to seat numbers. If a ticket is sold for one seat or another, then the corresponding element of the array has the value 1, otherwise it has the value 0. Write a program that determines the number of sold tickets for seats in the Kth row.

Input: The first line contains two numbers N (0<N<=15) and M (0<M<=25)
Next come N lines of M numbers each (each number is 0 or 1)
The last line contains the number K (1<=K<=N)
Output: print the answer to the problem

Examples
# Input Output
1 3 5
1 1 1 0 1 
0 0 0 1 1 
1 1 1 1 1 
3
5