Theater revenue
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
The theater has rows with seats. Two matrices are given. The first matrix contains the ticket prices for each seat. The second matrix tells which tickets are sold and which are not ( means the ticket is sold for a corresponding seat, is not sold).
Determine the total revenue from the performance.
Input
The first line contains and . Then the matrix with ticket prices is given ( lines with numbers, each number ranges from to ). Then given the matrix of sold tickets — lines with numbers.
Output
Print the total revenue from the ticket sales.
Examples
Input #1
Answer #1
Submissions 10K
Acceptance rate 57%