
import java.util.Scanner;

public class Main {
	static int APoints = 0;
	static int BPoints = 0;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		String strA;
		String strB;

		int n = sc.nextInt();
		for (int i = 0; i < n; i++) {
			strA = sc.next();
			strB = sc.next();
			calcPoints(strA, strB);
		}
		System.out.println(APoints + " " + BPoints);

	}

	static void calcPoints(String strA, String strB) {
		boolean isBiggerA = false;
		boolean isBiggerB = false;
		boolean isEqual = false;
		int length;
		if (strA.length() > strB.length()) {
			length = strB.length();
		} else {
			length = strA.length();
		}
		for (int i = 0; i < length; i++) {
			if (strA.charAt(i) > strB.charAt(i)) {
				isBiggerA = true;
				break;
			} else if (strA.charAt(i) < strB.charAt(i)) {
				isBiggerB = true;
				break;
			}

		}
		if ((isBiggerA == false) && (isBiggerB == false)) {
			if (strA.length() > strB.length()) {
				isBiggerA = true;
			} else if (strA.length() < strB.length()) {
				isBiggerB = true;
			} else {
				isEqual = true;
			}
		}

		if (isBiggerA) {
			APoints += 3;
		} else if (isBiggerB) {
			BPoints += 3;
		} else if (isEqual) {
			APoints++;
			BPoints++;
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {
	static int APoints = 0;
	static int BPoints = 0;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		String strA;
		String strB;

		int n = sc.nextInt();
		for (int i = 0; i < n; i++) {
			strA = sc.next();
			strB = sc.next();
			calcPoints(strA, strB);
		}
		System.out.println(APoints + " " + BPoints);

	}

	static void calcPoints(String strA, String strB) {
		boolean isBiggerA = false;
		boolean isBiggerB = false;
		boolean isEqual = false;
		int length;
		if (strA.length() > strB.length()) {
			length = strB.length();
		} else {
			length = strA.length();
		}
		for (int i = 0; i < length; i++) {
			if (strA.charAt(i) > strB.charAt(i)) {
				isBiggerA = true;
				break;
			} else if (strA.charAt(i) < strB.charAt(i)) {
				isBiggerB = true;
				break;
			}

		}
		if ((isBiggerA == false) && (isBiggerB == false)) {
			if (strA.length() > strB.length()) {
				isBiggerA = true;
			} else if (strA.length() < strB.length()) {
				isBiggerB = true;
			} else {
				isEqual = true;
			}
		}

		if (isBiggerA) {
			APoints += 3;
		} else if (isBiggerB) {
			BPoints += 3;
		} else if (isEqual) {
			APoints++;
			BPoints++;
		}
	}
} Main static int APoints = 0; APoints 0 static int BPoints = 0; BPoints 0 public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		String strA;
		String strB;

		int n = sc.nextInt();
		for (int i = 0; i < n; i++) {
			strA = sc.next();
			strB = sc.next();
			calcPoints(strA, strB);
		}
		System.out.println(APoints + " " + BPoints);

	} main {
		Scanner sc = new Scanner(System.in);

		String strA;
		String strB;

		int n = sc.nextInt();
		for (int i = 0; i < n; i++) {
			strA = sc.next();
			strB = sc.next();
			calcPoints(strA, strB);
		}
		System.out.println(APoints + " " + BPoints);

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String strA; strA String strB; strB int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc for (int i = 0; i < n; i++) {
			strA = sc.next();
			strB = sc.next();
			calcPoints(strA, strB);
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
			strA = sc.next();
			strB = sc.next();
			calcPoints(strA, strB);
		} {
			strA = sc.next();
			strB = sc.next();
			calcPoints(strA, strB);
		} strA = sc.next() strA sc.next() sc.next sc strB = sc.next() strB sc.next() sc.next sc calcPoints(strA, strB) calcPoints strA strB System.out.println(APoints + " " + BPoints) System.out.println System.out System System.out APoints + " " + BPoints APoints + " " + BPoints APoints " " BPoints String[] args args static void calcPoints(String strA, String strB) {
		boolean isBiggerA = false;
		boolean isBiggerB = false;
		boolean isEqual = false;
		int length;
		if (strA.length() > strB.length()) {
			length = strB.length();
		} else {
			length = strA.length();
		}
		for (int i = 0; i < length; i++) {
			if (strA.charAt(i) > strB.charAt(i)) {
				isBiggerA = true;
				break;
			} else if (strA.charAt(i) < strB.charAt(i)) {
				isBiggerB = true;
				break;
			}

		}
		if ((isBiggerA == false) && (isBiggerB == false)) {
			if (strA.length() > strB.length()) {
				isBiggerA = true;
			} else if (strA.length() < strB.length()) {
				isBiggerB = true;
			} else {
				isEqual = true;
			}
		}

		if (isBiggerA) {
			APoints += 3;
		} else if (isBiggerB) {
			BPoints += 3;
		} else if (isEqual) {
			APoints++;
			BPoints++;
		}
	} calcPoints {
		boolean isBiggerA = false;
		boolean isBiggerB = false;
		boolean isEqual = false;
		int length;
		if (strA.length() > strB.length()) {
			length = strB.length();
		} else {
			length = strA.length();
		}
		for (int i = 0; i < length; i++) {
			if (strA.charAt(i) > strB.charAt(i)) {
				isBiggerA = true;
				break;
			} else if (strA.charAt(i) < strB.charAt(i)) {
				isBiggerB = true;
				break;
			}

		}
		if ((isBiggerA == false) && (isBiggerB == false)) {
			if (strA.length() > strB.length()) {
				isBiggerA = true;
			} else if (strA.length() < strB.length()) {
				isBiggerB = true;
			} else {
				isEqual = true;
			}
		}

		if (isBiggerA) {
			APoints += 3;
		} else if (isBiggerB) {
			BPoints += 3;
		} else if (isEqual) {
			APoints++;
			BPoints++;
		}
	} boolean isBiggerA = false; isBiggerA false boolean isBiggerB = false; isBiggerB false boolean isEqual = false; isEqual false int length; length if (strA.length() > strB.length()) {
			length = strB.length();
		} else {
			length = strA.length();
		} strA.length() > strB.length() strA.length() strA.length strA strB.length() strB.length strB {
			length = strB.length();
		} length = strB.length() length strB.length() strB.length strB {
			length = strA.length();
		} length = strA.length() length strA.length() strA.length strA for (int i = 0; i < length; i++) {
			if (strA.charAt(i) > strB.charAt(i)) {
				isBiggerA = true;
				break;
			} else if (strA.charAt(i) < strB.charAt(i)) {
				isBiggerB = true;
				break;
			}

		} int i = 0; int i = 0; i 0 i < length i length i++ i++ i {
			if (strA.charAt(i) > strB.charAt(i)) {
				isBiggerA = true;
				break;
			} else if (strA.charAt(i) < strB.charAt(i)) {
				isBiggerB = true;
				break;
			}

		} {
			if (strA.charAt(i) > strB.charAt(i)) {
				isBiggerA = true;
				break;
			} else if (strA.charAt(i) < strB.charAt(i)) {
				isBiggerB = true;
				break;
			}

		} if (strA.charAt(i) > strB.charAt(i)) {
				isBiggerA = true;
				break;
			} else if (strA.charAt(i) < strB.charAt(i)) {
				isBiggerB = true;
				break;
			} strA.charAt(i) > strB.charAt(i) strA.charAt(i) strA.charAt strA i strB.charAt(i) strB.charAt strB i {
				isBiggerA = true;
				break;
			} isBiggerA = true isBiggerA true break; if (strA.charAt(i) < strB.charAt(i)) {
				isBiggerB = true;
				break;
			} strA.charAt(i) < strB.charAt(i) strA.charAt(i) strA.charAt strA i strB.charAt(i) strB.charAt strB i {
				isBiggerB = true;
				break;
			} isBiggerB = true isBiggerB true break; if ((isBiggerA == false) && (isBiggerB == false)) {
			if (strA.length() > strB.length()) {
				isBiggerA = true;
			} else if (strA.length() < strB.length()) {
				isBiggerB = true;
			} else {
				isEqual = true;
			}
		} (isBiggerA == false) && (isBiggerB == false) (isBiggerA == false) isBiggerA false (isBiggerB == false) isBiggerB false {
			if (strA.length() > strB.length()) {
				isBiggerA = true;
			} else if (strA.length() < strB.length()) {
				isBiggerB = true;
			} else {
				isEqual = true;
			}
		} if (strA.length() > strB.length()) {
				isBiggerA = true;
			} else if (strA.length() < strB.length()) {
				isBiggerB = true;
			} else {
				isEqual = true;
			} strA.length() > strB.length() strA.length() strA.length strA strB.length() strB.length strB {
				isBiggerA = true;
			} isBiggerA = true isBiggerA true if (strA.length() < strB.length()) {
				isBiggerB = true;
			} else {
				isEqual = true;
			} strA.length() < strB.length() strA.length() strA.length strA strB.length() strB.length strB {
				isBiggerB = true;
			} isBiggerB = true isBiggerB true {
				isEqual = true;
			} isEqual = true isEqual true if (isBiggerA) {
			APoints += 3;
		} else if (isBiggerB) {
			BPoints += 3;
		} else if (isEqual) {
			APoints++;
			BPoints++;
		} isBiggerA {
			APoints += 3;
		} APoints += 3 APoints 3 if (isBiggerB) {
			BPoints += 3;
		} else if (isEqual) {
			APoints++;
			BPoints++;
		} isBiggerB {
			BPoints += 3;
		} BPoints += 3 BPoints 3 if (isEqual) {
			APoints++;
			BPoints++;
		} isEqual {
			APoints++;
			BPoints++;
		} APoints++ APoints BPoints++ BPoints String strA strA String strB strB public class Main {
	static int APoints = 0;
	static int BPoints = 0;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		String strA;
		String strB;

		int n = sc.nextInt();
		for (int i = 0; i < n; i++) {
			strA = sc.next();
			strB = sc.next();
			calcPoints(strA, strB);
		}
		System.out.println(APoints + " " + BPoints);

	}

	static void calcPoints(String strA, String strB) {
		boolean isBiggerA = false;
		boolean isBiggerB = false;
		boolean isEqual = false;
		int length;
		if (strA.length() > strB.length()) {
			length = strB.length();
		} else {
			length = strA.length();
		}
		for (int i = 0; i < length; i++) {
			if (strA.charAt(i) > strB.charAt(i)) {
				isBiggerA = true;
				break;
			} else if (strA.charAt(i) < strB.charAt(i)) {
				isBiggerB = true;
				break;
			}

		}
		if ((isBiggerA == false) && (isBiggerB == false)) {
			if (strA.length() > strB.length()) {
				isBiggerA = true;
			} else if (strA.length() < strB.length()) {
				isBiggerB = true;
			} else {
				isEqual = true;
			}
		}

		if (isBiggerA) {
			APoints += 3;
		} else if (isBiggerB) {
			BPoints += 3;
		} else if (isEqual) {
			APoints++;
			BPoints++;
		}
	}
} public class Main {
	static int APoints = 0;
	static int BPoints = 0;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		String strA;
		String strB;

		int n = sc.nextInt();
		for (int i = 0; i < n; i++) {
			strA = sc.next();
			strB = sc.next();
			calcPoints(strA, strB);
		}
		System.out.println(APoints + " " + BPoints);

	}

	static void calcPoints(String strA, String strB) {
		boolean isBiggerA = false;
		boolean isBiggerB = false;
		boolean isEqual = false;
		int length;
		if (strA.length() > strB.length()) {
			length = strB.length();
		} else {
			length = strA.length();
		}
		for (int i = 0; i < length; i++) {
			if (strA.charAt(i) > strB.charAt(i)) {
				isBiggerA = true;
				break;
			} else if (strA.charAt(i) < strB.charAt(i)) {
				isBiggerB = true;
				break;
			}

		}
		if ((isBiggerA == false) && (isBiggerB == false)) {
			if (strA.length() > strB.length()) {
				isBiggerA = true;
			} else if (strA.length() < strB.length()) {
				isBiggerB = true;
			} else {
				isEqual = true;
			}
		}

		if (isBiggerA) {
			APoints += 3;
		} else if (isBiggerB) {
			BPoints += 3;
		} else if (isEqual) {
			APoints++;
			BPoints++;
		}
	}
} Main

import java.util.Scanner;

public class Main {
	static int APoints = 0;
	static int BPoints = 0;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		String strA;
		String strB;

		int n = sc.nextInt();
		for (int i = 0; i < n; i++) {
			strA = sc.next();
			strB = sc.next();
			calcPoints(strA, strB);
		}
		System.out.println(APoints + " " + BPoints);

	}

	static void calcPoints(String strA, String strB) {
		boolean isBiggerA = false;
		boolean isBiggerB = false;
		boolean isEqual = false;
		int length;
		if (strA.length() > strB.length()) {
			length = strB.length();
		} else {
			length = strA.length();
		}
		for (int i = 0; i < length; i++) {
			if (strA.charAt(i) > strB.charAt(i)) {
				isBiggerA = true;
				break;
			} else if (strA.charAt(i) < strB.charAt(i)) {
				isBiggerB = true;
				break;
			}

		}
		if ((isBiggerA == false) && (isBiggerB == false)) {
			if (strA.length() > strB.length()) {
				isBiggerA = true;
			} else if (strA.length() < strB.length()) {
				isBiggerB = true;
			} else {
				isEqual = true;
			}
		}

		if (isBiggerA) {
			APoints += 3;
		} else if (isBiggerB) {
			BPoints += 3;
		} else if (isEqual) {
			APoints++;
			BPoints++;
		}
	}
}