import java.io.*;

class Main {
	public static void main(String[] arg)throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int turn = Integer.parseInt(br.readLine());
		int p1 = 0,p2 = 0;
		for(int i=0; i<turn; i++){
			String[] ani = br.readLine().split(" ");
			if(ani[0].compareToIgnoreCase(ani[1]) > 0){
				p1 += 3;
			}
			else if(ani[0].compareToIgnoreCase(ani[1]) ==0){
				p1 += 1;
				p2 += 1;
			}
			else if(ani[0].compareToIgnoreCase(ani[1]) < 0){
				p2 += 3;
			}
		}
		System.out.println(p1+" "+p2);
	}
} import java.io.*; io.* java class Main {
	public static void main(String[] arg)throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int turn = Integer.parseInt(br.readLine());
		int p1 = 0,p2 = 0;
		for(int i=0; i<turn; i++){
			String[] ani = br.readLine().split(" ");
			if(ani[0].compareToIgnoreCase(ani[1]) > 0){
				p1 += 3;
			}
			else if(ani[0].compareToIgnoreCase(ani[1]) ==0){
				p1 += 1;
				p2 += 1;
			}
			else if(ani[0].compareToIgnoreCase(ani[1]) < 0){
				p2 += 3;
			}
		}
		System.out.println(p1+" "+p2);
	}
} Main public static void main(String[] arg)throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int turn = Integer.parseInt(br.readLine());
		int p1 = 0,p2 = 0;
		for(int i=0; i<turn; i++){
			String[] ani = br.readLine().split(" ");
			if(ani[0].compareToIgnoreCase(ani[1]) > 0){
				p1 += 3;
			}
			else if(ani[0].compareToIgnoreCase(ani[1]) ==0){
				p1 += 1;
				p2 += 1;
			}
			else if(ani[0].compareToIgnoreCase(ani[1]) < 0){
				p2 += 3;
			}
		}
		System.out.println(p1+" "+p2);
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int turn = Integer.parseInt(br.readLine());
		int p1 = 0,p2 = 0;
		for(int i=0; i<turn; i++){
			String[] ani = br.readLine().split(" ");
			if(ani[0].compareToIgnoreCase(ani[1]) > 0){
				p1 += 3;
			}
			else if(ani[0].compareToIgnoreCase(ani[1]) ==0){
				p1 += 1;
				p2 += 1;
			}
			else if(ani[0].compareToIgnoreCase(ani[1]) < 0){
				p2 += 3;
			}
		}
		System.out.println(p1+" "+p2);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int turn = Integer.parseInt(br.readLine()); turn Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int p1 = 0 p1 0 p2 = 0; p2 0 for(int i=0; i<turn; i++){
			String[] ani = br.readLine().split(" ");
			if(ani[0].compareToIgnoreCase(ani[1]) > 0){
				p1 += 3;
			}
			else if(ani[0].compareToIgnoreCase(ani[1]) ==0){
				p1 += 1;
				p2 += 1;
			}
			else if(ani[0].compareToIgnoreCase(ani[1]) < 0){
				p2 += 3;
			}
		} int i=0; int i=0; i 0 i<turn i turn i++ i++ i {
			String[] ani = br.readLine().split(" ");
			if(ani[0].compareToIgnoreCase(ani[1]) > 0){
				p1 += 3;
			}
			else if(ani[0].compareToIgnoreCase(ani[1]) ==0){
				p1 += 1;
				p2 += 1;
			}
			else if(ani[0].compareToIgnoreCase(ani[1]) < 0){
				p2 += 3;
			}
		} {
			String[] ani = br.readLine().split(" ");
			if(ani[0].compareToIgnoreCase(ani[1]) > 0){
				p1 += 3;
			}
			else if(ani[0].compareToIgnoreCase(ani[1]) ==0){
				p1 += 1;
				p2 += 1;
			}
			else if(ani[0].compareToIgnoreCase(ani[1]) < 0){
				p2 += 3;
			}
		} String[] ani = br.readLine().split(" "); ani br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " if(ani[0].compareToIgnoreCase(ani[1]) > 0){
				p1 += 3;
			}
			else if(ani[0].compareToIgnoreCase(ani[1]) ==0){
				p1 += 1;
				p2 += 1;
			}
			else if(ani[0].compareToIgnoreCase(ani[1]) < 0){
				p2 += 3;
			} ani[0].compareToIgnoreCase(ani[1]) > 0 ani[0].compareToIgnoreCase(ani[1]) ani[0].compareToIgnoreCase ani[0] ani 0 ani[1] ani 1 0 {
				p1 += 3;
			} p1 += 3 p1 3 if(ani[0].compareToIgnoreCase(ani[1]) ==0){
				p1 += 1;
				p2 += 1;
			}
			else if(ani[0].compareToIgnoreCase(ani[1]) < 0){
				p2 += 3;
			} ani[0].compareToIgnoreCase(ani[1]) ==0 ani[0].compareToIgnoreCase(ani[1]) ani[0].compareToIgnoreCase ani[0] ani 0 ani[1] ani 1 0 {
				p1 += 1;
				p2 += 1;
			} p1 += 1 p1 1 p2 += 1 p2 1 if(ani[0].compareToIgnoreCase(ani[1]) < 0){
				p2 += 3;
			} ani[0].compareToIgnoreCase(ani[1]) < 0 ani[0].compareToIgnoreCase(ani[1]) ani[0].compareToIgnoreCase ani[0] ani 0 ani[1] ani 1 0 {
				p2 += 3;
			} p2 += 3 p2 3 System.out.println(p1+" "+p2) System.out.println System.out System System.out p1+" "+p2 p1+" "+p2 p1 " " p2 String[] arg arg
import java.io.*;

class Main {
	public static void main(String[] arg)throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int turn = Integer.parseInt(br.readLine());
		int p1 = 0,p2 = 0;
		for(int i=0; i<turn; i++){
			String[] ani = br.readLine().split(" ");
			if(ani[0].compareToIgnoreCase(ani[1]) > 0){
				p1 += 3;
			}
			else if(ani[0].compareToIgnoreCase(ani[1]) ==0){
				p1 += 1;
				p2 += 1;
			}
			else if(ani[0].compareToIgnoreCase(ani[1]) < 0){
				p2 += 3;
			}
		}
		System.out.println(p1+" "+p2);
	}
}