

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		//???????????°
		int turns = Integer.parseInt(scan.nextLine());
		//?????¬??????????????????
		int player1 = 0;
		int player2 = 0;
		
		int jad;
		String str = scan.nextLine();
		String[] answer = str.split(" ");
		for (int i = 0; i < turns; i++) {
			jad = answer[0].compareTo(answer[1]);
			if(jad > 0){
				player1 += 3;
			}else if(jad < 0){
				player2 += 3;
			}else{
				player1++;
				player2++;
			}
			if(!(i == (turns - 1))){
				str = scan.nextLine();
				answer = str.split(" ");
			}
		}
		
		System.out.println(player1 + " " + player2);
		
	}

	
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		//???????????°
		int turns = Integer.parseInt(scan.nextLine());
		//?????¬??????????????????
		int player1 = 0;
		int player2 = 0;
		
		int jad;
		String str = scan.nextLine();
		String[] answer = str.split(" ");
		for (int i = 0; i < turns; i++) {
			jad = answer[0].compareTo(answer[1]);
			if(jad > 0){
				player1 += 3;
			}else if(jad < 0){
				player2 += 3;
			}else{
				player1++;
				player2++;
			}
			if(!(i == (turns - 1))){
				str = scan.nextLine();
				answer = str.split(" ");
			}
		}
		
		System.out.println(player1 + " " + player2);
		
	}

	
} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		//???????????°
		int turns = Integer.parseInt(scan.nextLine());
		//?????¬??????????????????
		int player1 = 0;
		int player2 = 0;
		
		int jad;
		String str = scan.nextLine();
		String[] answer = str.split(" ");
		for (int i = 0; i < turns; i++) {
			jad = answer[0].compareTo(answer[1]);
			if(jad > 0){
				player1 += 3;
			}else if(jad < 0){
				player2 += 3;
			}else{
				player1++;
				player2++;
			}
			if(!(i == (turns - 1))){
				str = scan.nextLine();
				answer = str.split(" ");
			}
		}
		
		System.out.println(player1 + " " + player2);
		
	} main {
		Scanner scan = new Scanner(System.in);
		//???????????°
		int turns = Integer.parseInt(scan.nextLine());
		//?????¬??????????????????
		int player1 = 0;
		int player2 = 0;
		
		int jad;
		String str = scan.nextLine();
		String[] answer = str.split(" ");
		for (int i = 0; i < turns; i++) {
			jad = answer[0].compareTo(answer[1]);
			if(jad > 0){
				player1 += 3;
			}else if(jad < 0){
				player2 += 3;
			}else{
				player1++;
				player2++;
			}
			if(!(i == (turns - 1))){
				str = scan.nextLine();
				answer = str.split(" ");
			}
		}
		
		System.out.println(player1 + " " + player2);
		
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int turns = Integer.parseInt(scan.nextLine()); turns Integer.parseInt(scan.nextLine()) Integer.parseInt Integer scan.nextLine() scan.nextLine scan int player1 = 0; player1 0 int player2 = 0; player2 0 int jad; jad String str = scan.nextLine(); str scan.nextLine() scan.nextLine scan String[] answer = str.split(" "); answer str.split(" ") str.split str " " for (int i = 0; i < turns; i++) {
			jad = answer[0].compareTo(answer[1]);
			if(jad > 0){
				player1 += 3;
			}else if(jad < 0){
				player2 += 3;
			}else{
				player1++;
				player2++;
			}
			if(!(i == (turns - 1))){
				str = scan.nextLine();
				answer = str.split(" ");
			}
		} int i = 0; int i = 0; i 0 i < turns i turns i++ i++ i {
			jad = answer[0].compareTo(answer[1]);
			if(jad > 0){
				player1 += 3;
			}else if(jad < 0){
				player2 += 3;
			}else{
				player1++;
				player2++;
			}
			if(!(i == (turns - 1))){
				str = scan.nextLine();
				answer = str.split(" ");
			}
		} {
			jad = answer[0].compareTo(answer[1]);
			if(jad > 0){
				player1 += 3;
			}else if(jad < 0){
				player2 += 3;
			}else{
				player1++;
				player2++;
			}
			if(!(i == (turns - 1))){
				str = scan.nextLine();
				answer = str.split(" ");
			}
		} jad = answer[0].compareTo(answer[1]) jad answer[0].compareTo(answer[1]) answer[0].compareTo answer[0] answer 0 answer[1] answer 1 if(jad > 0){
				player1 += 3;
			}else if(jad < 0){
				player2 += 3;
			}else{
				player1++;
				player2++;
			} jad > 0 jad 0 {
				player1 += 3;
			} player1 += 3 player1 3 if(jad < 0){
				player2 += 3;
			}else{
				player1++;
				player2++;
			} jad < 0 jad 0 {
				player2 += 3;
			} player2 += 3 player2 3 {
				player1++;
				player2++;
			} player1++ player1 player2++ player2 if(!(i == (turns - 1))){
				str = scan.nextLine();
				answer = str.split(" ");
			} !(i == (turns - 1)) (i == (turns - 1)) i (turns - 1) turns 1 {
				str = scan.nextLine();
				answer = str.split(" ");
			} str = scan.nextLine() str scan.nextLine() scan.nextLine scan answer = str.split(" ") answer str.split(" ") str.split str " " System.out.println(player1 + " " + player2) System.out.println System.out System System.out player1 + " " + player2 player1 + " " + player2 player1 " " player2 String[] args args public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		//???????????°
		int turns = Integer.parseInt(scan.nextLine());
		//?????¬??????????????????
		int player1 = 0;
		int player2 = 0;
		
		int jad;
		String str = scan.nextLine();
		String[] answer = str.split(" ");
		for (int i = 0; i < turns; i++) {
			jad = answer[0].compareTo(answer[1]);
			if(jad > 0){
				player1 += 3;
			}else if(jad < 0){
				player2 += 3;
			}else{
				player1++;
				player2++;
			}
			if(!(i == (turns - 1))){
				str = scan.nextLine();
				answer = str.split(" ");
			}
		}
		
		System.out.println(player1 + " " + player2);
		
	}

	
} public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		//???????????°
		int turns = Integer.parseInt(scan.nextLine());
		//?????¬??????????????????
		int player1 = 0;
		int player2 = 0;
		
		int jad;
		String str = scan.nextLine();
		String[] answer = str.split(" ");
		for (int i = 0; i < turns; i++) {
			jad = answer[0].compareTo(answer[1]);
			if(jad > 0){
				player1 += 3;
			}else if(jad < 0){
				player2 += 3;
			}else{
				player1++;
				player2++;
			}
			if(!(i == (turns - 1))){
				str = scan.nextLine();
				answer = str.split(" ");
			}
		}
		
		System.out.println(player1 + " " + player2);
		
	}

	
} Main


import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		//???????????°
		int turns = Integer.parseInt(scan.nextLine());
		//?????¬??????????????????
		int player1 = 0;
		int player2 = 0;
		
		int jad;
		String str = scan.nextLine();
		String[] answer = str.split(" ");
		for (int i = 0; i < turns; i++) {
			jad = answer[0].compareTo(answer[1]);
			if(jad > 0){
				player1 += 3;
			}else if(jad < 0){
				player2 += 3;
			}else{
				player1++;
				player2++;
			}
			if(!(i == (turns - 1))){
				str = scan.nextLine();
				answer = str.split(" ");
			}
		}
		
		System.out.println(player1 + " " + player2);
		
	}

	
}