import java.util.Scanner;

class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String t_card, h_card;
		int t_cnt = 0, h_cnt = 0, com;
		int cnt = sc.nextInt();
		for(int i=0; i<cnt; i++){
			t_card = sc.next();
			h_card = sc.next();
			com = t_card.compareTo(h_card);
			if(com==0){ t_cnt++; h_cnt++; }
			else if(com>0) t_cnt+=3;
			else h_cnt+=3;
		}
		System.out.println(t_cnt + " " + h_cnt);
	}
} import java.util.Scanner; Scanner java.util class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String t_card, h_card;
		int t_cnt = 0, h_cnt = 0, com;
		int cnt = sc.nextInt();
		for(int i=0; i<cnt; i++){
			t_card = sc.next();
			h_card = sc.next();
			com = t_card.compareTo(h_card);
			if(com==0){ t_cnt++; h_cnt++; }
			else if(com>0) t_cnt+=3;
			else h_cnt+=3;
		}
		System.out.println(t_cnt + " " + h_cnt);
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String t_card, h_card;
		int t_cnt = 0, h_cnt = 0, com;
		int cnt = sc.nextInt();
		for(int i=0; i<cnt; i++){
			t_card = sc.next();
			h_card = sc.next();
			com = t_card.compareTo(h_card);
			if(com==0){ t_cnt++; h_cnt++; }
			else if(com>0) t_cnt+=3;
			else h_cnt+=3;
		}
		System.out.println(t_cnt + " " + h_cnt);
	} main {
		Scanner sc = new Scanner(System.in);
		String t_card, h_card;
		int t_cnt = 0, h_cnt = 0, com;
		int cnt = sc.nextInt();
		for(int i=0; i<cnt; i++){
			t_card = sc.next();
			h_card = sc.next();
			com = t_card.compareTo(h_card);
			if(com==0){ t_cnt++; h_cnt++; }
			else if(com>0) t_cnt+=3;
			else h_cnt+=3;
		}
		System.out.println(t_cnt + " " + h_cnt);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String t_card t_card h_card; h_card int t_cnt = 0 t_cnt 0 h_cnt = 0 h_cnt 0 com; com int cnt = sc.nextInt(); cnt sc.nextInt() sc.nextInt sc for(int i=0; i<cnt; i++){
			t_card = sc.next();
			h_card = sc.next();
			com = t_card.compareTo(h_card);
			if(com==0){ t_cnt++; h_cnt++; }
			else if(com>0) t_cnt+=3;
			else h_cnt+=3;
		} int i=0; int i=0; i 0 i<cnt i cnt i++ i++ i {
			t_card = sc.next();
			h_card = sc.next();
			com = t_card.compareTo(h_card);
			if(com==0){ t_cnt++; h_cnt++; }
			else if(com>0) t_cnt+=3;
			else h_cnt+=3;
		} {
			t_card = sc.next();
			h_card = sc.next();
			com = t_card.compareTo(h_card);
			if(com==0){ t_cnt++; h_cnt++; }
			else if(com>0) t_cnt+=3;
			else h_cnt+=3;
		} t_card = sc.next() t_card sc.next() sc.next sc h_card = sc.next() h_card sc.next() sc.next sc com = t_card.compareTo(h_card) com t_card.compareTo(h_card) t_card.compareTo t_card h_card if(com==0){ t_cnt++; h_cnt++; }
			else if(com>0) t_cnt+=3;
			else h_cnt+=3; com==0 com 0 { t_cnt++; h_cnt++; } t_cnt++ t_cnt h_cnt++ h_cnt if(com>0) t_cnt+=3;
			else h_cnt+=3; com>0 com 0 t_cnt+=3 t_cnt 3 h_cnt+=3 h_cnt 3 System.out.println(t_cnt + " " + h_cnt) System.out.println System.out System System.out t_cnt + " " + h_cnt t_cnt + " " + h_cnt t_cnt " " h_cnt String[] args args
import java.util.Scanner;

class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String t_card, h_card;
		int t_cnt = 0, h_cnt = 0, com;
		int cnt = sc.nextInt();
		for(int i=0; i<cnt; i++){
			t_card = sc.next();
			h_card = sc.next();
			com = t_card.compareTo(h_card);
			if(com==0){ t_cnt++; h_cnt++; }
			else if(com>0) t_cnt+=3;
			else h_cnt+=3;
		}
		System.out.println(t_cnt + " " + h_cnt);
	}
}