import java.util.ArrayList;
import java.util.Scanner;

/**
 *
 * @author student
 */
public class Universe {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int countPlus = 0, countNeg = 0;
        int maxSize = 0;
        int count = sc.nextInt();
        int size = sc.nextInt();
        ArrayList<String> inputs = new ArrayList<String>();
        ArrayList<String> buffers = new ArrayList<String>();
        for (int i = 0; i < count; i++) {
            inputs.add(sc.next());
        }
        for (int i = 0; i < count; i++) {
            String line = inputs.get(i);
            //System.out.println("line " + i + " " + line);
            int stringLength = line.length();
            StringBuffer bf = new StringBuffer();
            for (int j = 0; j < stringLength - 1; j++) {
                char first = line.charAt(j);
                char second = line.charAt(j + 1);
                if (first == '+' && second == '+') {
                    bf.append(first);
                    bf.append('-');
                    countNeg++;
                } else if (first == '-' && second == '-') {
                    bf.append(first);
                    bf.append('+');
                    countPlus++;
                } else {
                    bf.append(first);
                }
                //System.out.println("first " + first + ",appended " + bf.toString());
                //System.out.println("first=" + first + ", second=" + second);
            }
            bf.append(line.charAt(stringLength-1));
            String tmpLine = bf.toString();
            buffers.add(tmpLine);
            if (tmpLine.length() > maxSize) {
                maxSize = tmpLine.length();
            }
            //System.out.println("" + tmpLine);
        }
        //System.out.println(String.format("befor %d %d", countPlus, countNeg));
        for (String string : buffers) {
            int tmpSize = string.length();
            if (tmpSize < maxSize) {
                int diff = Math.abs(maxSize - tmpSize);
                //System.out.println(string + ", diff=" + diff);
                char last = string.charAt(string.length() - 1);
                int mod = diff / 2;
                int remain = diff - mod;
                //System.out.println("mod = " + mod + ",remain=" + remain);
                if (last == '+') {
                    countPlus += mod;
                    countNeg += remain;
                } else {
                    countNeg += mod;
                    countPlus += remain;
                }
            }
        }
        System.out.println(String.format("%d %d", countPlus, countNeg));
    }
}

