#include <stdio.h>

int main()
{
    int m = 0;
    int n = 0;
    int sum = 0;
    int num = 0; //接收输入的值
    //输入
    scanf("%d %d", &m, &n);
    for (int i = 0; i < m; i++)
    {
        for (int j = 0; j < n; j++)
        {
            scanf("%d", &num);
            if (num > 0)
            {
                sum += num;
            }
        }
    }
    //输出
    printf("%d\n", sum);

    return 0;
}