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();
	}

} import java.util.Scanner; Scanner java.util 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();
	}

} 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();
	} main {
		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();
	} Scanner stdIn = new Scanner(System.in); stdIn new Scanner(System.in) String word1 = ""; word1 "" String word2 = ""; word2 "" int n = 0; n 0 int pointA = 0; pointA 0 int pointB = 0; pointB 0 n = stdIn.nextInt() n stdIn.nextInt() stdIn.nextInt stdIn 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;
			}
		} int i = 0; int i = 0; i 0 i < n i n i++ i++ 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;
			}
		} {
			// ???????????\???
			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;
			}
		} word1 = stdIn.next() word1 stdIn.next() stdIn.next stdIn word2 = stdIn.next() word2 stdIn.next() stdIn.next stdIn int result = word1.compareTo(word2); result word1.compareTo(word2) word1.compareTo word1 word2 if (result > 0) {
				// ?????????+3???
				pointA = pointA + 3;
			} else if (result == 0) {
				// ????????¨??±??????+1???
				pointA = pointA +1;
				pointB = pointB +1;
			} else {
				// ??±??????+3???
				pointB = pointB +3;
			} result > 0 result 0 {
				// ?????????+3???
				pointA = pointA + 3;
			} pointA = pointA + 3 pointA pointA + 3 pointA 3 if (result == 0) {
				// ????????¨??±??????+1???
				pointA = pointA +1;
				pointB = pointB +1;
			} else {
				// ??±??????+3???
				pointB = pointB +3;
			} result == 0 result 0 {
				// ????????¨??±??????+1???
				pointA = pointA +1;
				pointB = pointB +1;
			} pointA = pointA +1 pointA pointA +1 pointA 1 pointB = pointB +1 pointB pointB +1 pointB 1 {
				// ??±??????+3???
				pointB = pointB +3;
			} pointB = pointB +3 pointB pointB +3 pointB 3 System.out.println(pointA + " " + pointB) System.out.println System.out System System.out pointA + " " + pointB pointA + " " + pointB pointA " " pointB stdIn.close() stdIn.close stdIn String[] args args 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();
	}

} 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();
	}

} Main
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();
	}

}