Chess board (2) P13623


Statement
 

pdf   zip

thehtml

Consider a chess board with r rows and c columns, where every square contains between 0 and 9 coins. Supose that the upper-left square is white. For instance, this is an empty board with four rows and five columns:

showmover=false, label=false, maxfield=e4

Write a program such that, given a chess board, computes the total number of coins on its white squares.

Input

Input begins with the number of rows r and the number of columns c. Follow r lines, each one with c characters between ‘0’ and ‘9’.

Output

Print the total number of coins on the white squares of the board.

Public test cases
  • Input

    3 4
    2735
    0479
    1508
    

    Output

    19
    
  • Input

    1 20
    01234567890123456789
    

    Output

    40
    
  • Input

    2 1
    4
    5
    

    Output

    4
    
  • Information
    Author
    Salvador Roura
    Language
    English
    Translator
    Salvador Roura
    Original language
    Catalan
    Other languages
    Catalan
    Official solutions
    C++ Java Python
    User solutions
    C C++ Java Python