import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
class Main {
	public static void main(String...args)throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int times = Integer.valueOf(br.readLine());
		int[] result = new int[2];
		for(int i = 0; i < times; i++) {
			String[] animals = br.readLine().split(" ");
    		if(animals[0].compareTo(animals[1]) == 0) {
    			result[0] += 1;
    			result[1] += 1;
    		} else if(animals[0].compareTo(animals[1]) >= 1) {
    			result[0] += 3;
    		} else if(animals[0].compareTo(animals[1]) <= -1) {
    			result[1] += 3;
    		}
		}
		System.out.println(result[0] + " " + result[1]);
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.IOException; IOException java.io class Main {
	public static void main(String...args)throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int times = Integer.valueOf(br.readLine());
		int[] result = new int[2];
		for(int i = 0; i < times; i++) {
			String[] animals = br.readLine().split(" ");
    		if(animals[0].compareTo(animals[1]) == 0) {
    			result[0] += 1;
    			result[1] += 1;
    		} else if(animals[0].compareTo(animals[1]) >= 1) {
    			result[0] += 3;
    		} else if(animals[0].compareTo(animals[1]) <= -1) {
    			result[1] += 3;
    		}
		}
		System.out.println(result[0] + " " + result[1]);
	}
} Main public static void main(String...args)throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int times = Integer.valueOf(br.readLine());
		int[] result = new int[2];
		for(int i = 0; i < times; i++) {
			String[] animals = br.readLine().split(" ");
    		if(animals[0].compareTo(animals[1]) == 0) {
    			result[0] += 1;
    			result[1] += 1;
    		} else if(animals[0].compareTo(animals[1]) >= 1) {
    			result[0] += 3;
    		} else if(animals[0].compareTo(animals[1]) <= -1) {
    			result[1] += 3;
    		}
		}
		System.out.println(result[0] + " " + result[1]);
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int times = Integer.valueOf(br.readLine());
		int[] result = new int[2];
		for(int i = 0; i < times; i++) {
			String[] animals = br.readLine().split(" ");
    		if(animals[0].compareTo(animals[1]) == 0) {
    			result[0] += 1;
    			result[1] += 1;
    		} else if(animals[0].compareTo(animals[1]) >= 1) {
    			result[0] += 3;
    		} else if(animals[0].compareTo(animals[1]) <= -1) {
    			result[1] += 3;
    		}
		}
		System.out.println(result[0] + " " + result[1]);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int times = Integer.valueOf(br.readLine()); times Integer.valueOf(br.readLine()) Integer.valueOf Integer br.readLine() br.readLine br int[] result = new int[2]; result new int[2] 2 for(int i = 0; i < times; i++) {
			String[] animals = br.readLine().split(" ");
    		if(animals[0].compareTo(animals[1]) == 0) {
    			result[0] += 1;
    			result[1] += 1;
    		} else if(animals[0].compareTo(animals[1]) >= 1) {
    			result[0] += 3;
    		} else if(animals[0].compareTo(animals[1]) <= -1) {
    			result[1] += 3;
    		}
		} int i = 0; int i = 0; i 0 i < times i times i++ i++ i {
			String[] animals = br.readLine().split(" ");
    		if(animals[0].compareTo(animals[1]) == 0) {
    			result[0] += 1;
    			result[1] += 1;
    		} else if(animals[0].compareTo(animals[1]) >= 1) {
    			result[0] += 3;
    		} else if(animals[0].compareTo(animals[1]) <= -1) {
    			result[1] += 3;
    		}
		} {
			String[] animals = br.readLine().split(" ");
    		if(animals[0].compareTo(animals[1]) == 0) {
    			result[0] += 1;
    			result[1] += 1;
    		} else if(animals[0].compareTo(animals[1]) >= 1) {
    			result[0] += 3;
    		} else if(animals[0].compareTo(animals[1]) <= -1) {
    			result[1] += 3;
    		}
		} String[] animals = br.readLine().split(" "); animals br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " if(animals[0].compareTo(animals[1]) == 0) {
    			result[0] += 1;
    			result[1] += 1;
    		} else if(animals[0].compareTo(animals[1]) >= 1) {
    			result[0] += 3;
    		} else if(animals[0].compareTo(animals[1]) <= -1) {
    			result[1] += 3;
    		} animals[0].compareTo(animals[1]) == 0 animals[0].compareTo(animals[1]) animals[0].compareTo animals[0] animals 0 animals[1] animals 1 0 {
    			result[0] += 1;
    			result[1] += 1;
    		} result[0] += 1 result[0] result 0 1 result[1] += 1 result[1] result 1 1 if(animals[0].compareTo(animals[1]) >= 1) {
    			result[0] += 3;
    		} else if(animals[0].compareTo(animals[1]) <= -1) {
    			result[1] += 3;
    		} animals[0].compareTo(animals[1]) >= 1 animals[0].compareTo(animals[1]) animals[0].compareTo animals[0] animals 0 animals[1] animals 1 1 {
    			result[0] += 3;
    		} result[0] += 3 result[0] result 0 3 if(animals[0].compareTo(animals[1]) <= -1) {
    			result[1] += 3;
    		} animals[0].compareTo(animals[1]) <= -1 animals[0].compareTo(animals[1]) animals[0].compareTo animals[0] animals 0 animals[1] animals 1 -1 1 {
    			result[1] += 3;
    		} result[1] += 3 result[1] result 1 3 System.out.println(result[0] + " " + result[1]) System.out.println System.out System System.out result[0] + " " + result[1] result[0] + " " + result[1] result[0] result 0 " " result[1] result 1 String...args args
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;
class Main {
	public static void main(String...args)throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int times = Integer.valueOf(br.readLine());
		int[] result = new int[2];
		for(int i = 0; i < times; i++) {
			String[] animals = br.readLine().split(" ");
    		if(animals[0].compareTo(animals[1]) == 0) {
    			result[0] += 1;
    			result[1] += 1;
    		} else if(animals[0].compareTo(animals[1]) >= 1) {
    			result[0] += 3;
    		} else if(animals[0].compareTo(animals[1]) <= -1) {
    			result[1] += 3;
    		}
		}
		System.out.println(result[0] + " " + result[1]);
	}
}
