import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		String word1 = "";
		String word2 = "";
		int n = 0;
		int pointA = 0;
		int pointB = 0;

		// ??????????????°??????????????°
		n = stdIn.nextInt();

		for (int i = 0; i < n; i++) {
			// ???????????\???
			word1 = stdIn.next();
			word2 = stdIn.next();
			int result = word1.compareTo(word2);
			if (result > 0) {
				// ?????????+3???
				pointA = pointA + 3;
			} else if (result == 0) {
				// ????????¨??±??????+1???
				pointA = pointA +1;
				pointB = pointB +1;
			} else {
				// ??±??????+3???
				pointB = pointB +3;
			}
		}

		System.out.println(pointA + " " + pointB);

		stdIn.close();
	}

}
/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz