import java.io.*;

class Main{
	public static void main(String[] args)throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int h = Integer.parseInt(br.readLine());
		int x=0,y=0;
		for(int i=0 ;i<h ;i++){
			String[] str = br.readLine().split(" ");
			if(str[0].compareTo(str[1])>0){
				x = x + 3;
			}else if(str[0].compareTo(str[1])<0){
				y = y + 3;
			}else{
				x++;
				y++;
			}
		}
		System.out.println(x + " " + y);
	}
} import java.io.*; io.* java class Main{
	public static void main(String[] args)throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int h = Integer.parseInt(br.readLine());
		int x=0,y=0;
		for(int i=0 ;i<h ;i++){
			String[] str = br.readLine().split(" ");
			if(str[0].compareTo(str[1])>0){
				x = x + 3;
			}else if(str[0].compareTo(str[1])<0){
				y = y + 3;
			}else{
				x++;
				y++;
			}
		}
		System.out.println(x + " " + y);
	}
} Main public static void main(String[] args)throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int h = Integer.parseInt(br.readLine());
		int x=0,y=0;
		for(int i=0 ;i<h ;i++){
			String[] str = br.readLine().split(" ");
			if(str[0].compareTo(str[1])>0){
				x = x + 3;
			}else if(str[0].compareTo(str[1])<0){
				y = y + 3;
			}else{
				x++;
				y++;
			}
		}
		System.out.println(x + " " + y);
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int h = Integer.parseInt(br.readLine());
		int x=0,y=0;
		for(int i=0 ;i<h ;i++){
			String[] str = br.readLine().split(" ");
			if(str[0].compareTo(str[1])>0){
				x = x + 3;
			}else if(str[0].compareTo(str[1])<0){
				y = y + 3;
			}else{
				x++;
				y++;
			}
		}
		System.out.println(x + " " + y);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int h = Integer.parseInt(br.readLine()); h Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int x=0 x 0 y=0; y 0 for(int i=0 ;i<h ;i++){
			String[] str = br.readLine().split(" ");
			if(str[0].compareTo(str[1])>0){
				x = x + 3;
			}else if(str[0].compareTo(str[1])<0){
				y = y + 3;
			}else{
				x++;
				y++;
			}
		} int i=0 ; int i=0 ; i 0 i<h i h i++ i++ i {
			String[] str = br.readLine().split(" ");
			if(str[0].compareTo(str[1])>0){
				x = x + 3;
			}else if(str[0].compareTo(str[1])<0){
				y = y + 3;
			}else{
				x++;
				y++;
			}
		} {
			String[] str = br.readLine().split(" ");
			if(str[0].compareTo(str[1])>0){
				x = x + 3;
			}else if(str[0].compareTo(str[1])<0){
				y = y + 3;
			}else{
				x++;
				y++;
			}
		} String[] str = br.readLine().split(" "); str br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " if(str[0].compareTo(str[1])>0){
				x = x + 3;
			}else if(str[0].compareTo(str[1])<0){
				y = y + 3;
			}else{
				x++;
				y++;
			} str[0].compareTo(str[1])>0 str[0].compareTo(str[1]) str[0].compareTo str[0] str 0 str[1] str 1 0 {
				x = x + 3;
			} x = x + 3 x x + 3 x 3 if(str[0].compareTo(str[1])<0){
				y = y + 3;
			}else{
				x++;
				y++;
			} str[0].compareTo(str[1])<0 str[0].compareTo(str[1]) str[0].compareTo str[0] str 0 str[1] str 1 0 {
				y = y + 3;
			} y = y + 3 y y + 3 y 3 {
				x++;
				y++;
			} x++ x y++ y System.out.println(x + " " + y) System.out.println System.out System System.out x + " " + y x + " " + y x " " y String[] args args
import java.io.*;

class Main{
	public static void main(String[] args)throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int h = Integer.parseInt(br.readLine());
		int x=0,y=0;
		for(int i=0 ;i<h ;i++){
			String[] str = br.readLine().split(" ");
			if(str[0].compareTo(str[1])>0){
				x = x + 3;
			}else if(str[0].compareTo(str[1])<0){
				y = y + 3;
			}else{
				x++;
				y++;
			}
		}
		System.out.println(x + " " + y);
	}
}