#C14266. Count Cars
Count Cars
Count Cars
Given a parking lot represented as a 2D grid where each cell contains either 0 or 1, count the total number of parked cars. A cell with a value of 1 represents a parked car.
The first line of input specifies the number of rows n in the parking lot. The following n lines each contain a series of space-separated integers (0 or 1) indicating the presence of a car.
Note: Input should be read from standard input (stdin) and output should be written to standard output (stdout).
inputFormat
The first line contains an integer n representing the number of rows in the parking lot. Each of the next n lines contains space-separated integers (either 0 or 1) representing each row of the parking lot.
outputFormat
Output a single integer representing the total number of parked cars.
## sample4
1 0 0 0
0 1 1 0
1 0 0 1
0 0 0 0
5