import java.util.Scanner;

public class Main {
		static int CARD_MAX=1000;
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		String[] taro =new String[n];
		String[] hana =new String[n];
		int taro_score=0;
		int hana_score=0;
		
		for(int i=0;i<n;i++){
			 taro[i] = scan.next();
			 hana[i] = scan.next();
			if(taro[i].compareTo(hana[i])==0){
				taro_score++;
				hana_score++;
			}else if(taro[i].compareTo(hana[i])>0){
				taro_score=taro_score +3;
			}else{
				hana_score= hana_score+3;
		}
		
			
		}

		System.out.println(taro_score+" "+hana_score);
		
	}



public static String shutffleString(String str,int h){
		String before = new String();
		String after = new String();

		for(int i = 0 ; i<h ; i++){
			before = before + str.charAt(i);
		}
		for(int i=h ; i < str.length() ;i++){
			after = after + str.charAt(i);
		}
			str = after + before;

	return str;
}

} import java.util.Scanner; Scanner java.util public class Main {
		static int CARD_MAX=1000;
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		String[] taro =new String[n];
		String[] hana =new String[n];
		int taro_score=0;
		int hana_score=0;
		
		for(int i=0;i<n;i++){
			 taro[i] = scan.next();
			 hana[i] = scan.next();
			if(taro[i].compareTo(hana[i])==0){
				taro_score++;
				hana_score++;
			}else if(taro[i].compareTo(hana[i])>0){
				taro_score=taro_score +3;
			}else{
				hana_score= hana_score+3;
		}
		
			
		}

		System.out.println(taro_score+" "+hana_score);
		
	}



public static String shutffleString(String str,int h){
		String before = new String();
		String after = new String();

		for(int i = 0 ; i<h ; i++){
			before = before + str.charAt(i);
		}
		for(int i=h ; i < str.length() ;i++){
			after = after + str.charAt(i);
		}
			str = after + before;

	return str;
}

} Main static int CARD_MAX=1000; CARD_MAX 1000 public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		String[] taro =new String[n];
		String[] hana =new String[n];
		int taro_score=0;
		int hana_score=0;
		
		for(int i=0;i<n;i++){
			 taro[i] = scan.next();
			 hana[i] = scan.next();
			if(taro[i].compareTo(hana[i])==0){
				taro_score++;
				hana_score++;
			}else if(taro[i].compareTo(hana[i])>0){
				taro_score=taro_score +3;
			}else{
				hana_score= hana_score+3;
		}
		
			
		}

		System.out.println(taro_score+" "+hana_score);
		
	} main {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		String[] taro =new String[n];
		String[] hana =new String[n];
		int taro_score=0;
		int hana_score=0;
		
		for(int i=0;i<n;i++){
			 taro[i] = scan.next();
			 hana[i] = scan.next();
			if(taro[i].compareTo(hana[i])==0){
				taro_score++;
				hana_score++;
			}else if(taro[i].compareTo(hana[i])>0){
				taro_score=taro_score +3;
			}else{
				hana_score= hana_score+3;
		}
		
			
		}

		System.out.println(taro_score+" "+hana_score);
		
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan String[] taro =new String[n]; taro new String[n] n String[] hana =new String[n]; hana new String[n] n int taro_score=0; taro_score 0 int hana_score=0; hana_score 0 for(int i=0;i<n;i++){
			 taro[i] = scan.next();
			 hana[i] = scan.next();
			if(taro[i].compareTo(hana[i])==0){
				taro_score++;
				hana_score++;
			}else if(taro[i].compareTo(hana[i])>0){
				taro_score=taro_score +3;
			}else{
				hana_score= hana_score+3;
		}
		
			
		} int i=0; int i=0; i 0 i<n i n i++ i++ i {
			 taro[i] = scan.next();
			 hana[i] = scan.next();
			if(taro[i].compareTo(hana[i])==0){
				taro_score++;
				hana_score++;
			}else if(taro[i].compareTo(hana[i])>0){
				taro_score=taro_score +3;
			}else{
				hana_score= hana_score+3;
		}
		
			
		} {
			 taro[i] = scan.next();
			 hana[i] = scan.next();
			if(taro[i].compareTo(hana[i])==0){
				taro_score++;
				hana_score++;
			}else if(taro[i].compareTo(hana[i])>0){
				taro_score=taro_score +3;
			}else{
				hana_score= hana_score+3;
		}
		
			
		} taro[i] = scan.next() taro[i] taro i scan.next() scan.next scan hana[i] = scan.next() hana[i] hana i scan.next() scan.next scan if(taro[i].compareTo(hana[i])==0){
				taro_score++;
				hana_score++;
			}else if(taro[i].compareTo(hana[i])>0){
				taro_score=taro_score +3;
			}else{
				hana_score= hana_score+3;
		} taro[i].compareTo(hana[i])==0 taro[i].compareTo(hana[i]) taro[i].compareTo taro[i] taro i hana[i] hana i 0 {
				taro_score++;
				hana_score++;
			} taro_score++ taro_score hana_score++ hana_score if(taro[i].compareTo(hana[i])>0){
				taro_score=taro_score +3;
			}else{
				hana_score= hana_score+3;
		} taro[i].compareTo(hana[i])>0 taro[i].compareTo(hana[i]) taro[i].compareTo taro[i] taro i hana[i] hana i 0 {
				taro_score=taro_score +3;
			} taro_score=taro_score +3 taro_score taro_score +3 taro_score 3 {
				hana_score= hana_score+3;
		} hana_score= hana_score+3 hana_score hana_score+3 hana_score 3 System.out.println(taro_score+" "+hana_score) System.out.println System.out System System.out taro_score+" "+hana_score taro_score+" "+hana_score taro_score " " hana_score String[] args args public static String shutffleString(String str,int h){
		String before = new String();
		String after = new String();

		for(int i = 0 ; i<h ; i++){
			before = before + str.charAt(i);
		}
		for(int i=h ; i < str.length() ;i++){
			after = after + str.charAt(i);
		}
			str = after + before;

	return str;
} shutffleString {
		String before = new String();
		String after = new String();

		for(int i = 0 ; i<h ; i++){
			before = before + str.charAt(i);
		}
		for(int i=h ; i < str.length() ;i++){
			after = after + str.charAt(i);
		}
			str = after + before;

	return str;
} String before = new String(); before new String() String after = new String(); after new String() for(int i = 0 ; i<h ; i++){
			before = before + str.charAt(i);
		} int i = 0 ; int i = 0 ; i 0 i<h i h i++ i++ i {
			before = before + str.charAt(i);
		} {
			before = before + str.charAt(i);
		} before = before + str.charAt(i) before before + str.charAt(i) before str.charAt(i) str.charAt str i for(int i=h ; i < str.length() ;i++){
			after = after + str.charAt(i);
		} int i=h ; int i=h ; i h i < str.length() i str.length() str.length str i++ i++ i {
			after = after + str.charAt(i);
		} {
			after = after + str.charAt(i);
		} after = after + str.charAt(i) after after + str.charAt(i) after str.charAt(i) str.charAt str i str = after + before str after + before after before return str; str String str str int h h public class Main {
		static int CARD_MAX=1000;
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		String[] taro =new String[n];
		String[] hana =new String[n];
		int taro_score=0;
		int hana_score=0;
		
		for(int i=0;i<n;i++){
			 taro[i] = scan.next();
			 hana[i] = scan.next();
			if(taro[i].compareTo(hana[i])==0){
				taro_score++;
				hana_score++;
			}else if(taro[i].compareTo(hana[i])>0){
				taro_score=taro_score +3;
			}else{
				hana_score= hana_score+3;
		}
		
			
		}

		System.out.println(taro_score+" "+hana_score);
		
	}



public static String shutffleString(String str,int h){
		String before = new String();
		String after = new String();

		for(int i = 0 ; i<h ; i++){
			before = before + str.charAt(i);
		}
		for(int i=h ; i < str.length() ;i++){
			after = after + str.charAt(i);
		}
			str = after + before;

	return str;
}

} public class Main {
		static int CARD_MAX=1000;
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		String[] taro =new String[n];
		String[] hana =new String[n];
		int taro_score=0;
		int hana_score=0;
		
		for(int i=0;i<n;i++){
			 taro[i] = scan.next();
			 hana[i] = scan.next();
			if(taro[i].compareTo(hana[i])==0){
				taro_score++;
				hana_score++;
			}else if(taro[i].compareTo(hana[i])>0){
				taro_score=taro_score +3;
			}else{
				hana_score= hana_score+3;
		}
		
			
		}

		System.out.println(taro_score+" "+hana_score);
		
	}



public static String shutffleString(String str,int h){
		String before = new String();
		String after = new String();

		for(int i = 0 ; i<h ; i++){
			before = before + str.charAt(i);
		}
		for(int i=h ; i < str.length() ;i++){
			after = after + str.charAt(i);
		}
			str = after + before;

	return str;
}

} Main
import java.util.Scanner;

public class Main {
		static int CARD_MAX=1000;
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		String[] taro =new String[n];
		String[] hana =new String[n];
		int taro_score=0;
		int hana_score=0;
		
		for(int i=0;i<n;i++){
			 taro[i] = scan.next();
			 hana[i] = scan.next();
			if(taro[i].compareTo(hana[i])==0){
				taro_score++;
				hana_score++;
			}else if(taro[i].compareTo(hana[i])>0){
				taro_score=taro_score +3;
			}else{
				hana_score= hana_score+3;
		}
		
			
		}

		System.out.println(taro_score+" "+hana_score);
		
	}



public static String shutffleString(String str,int h){
		String before = new String();
		String after = new String();

		for(int i = 0 ; i<h ; i++){
			before = before + str.charAt(i);
		}
		for(int i=h ; i < str.length() ;i++){
			after = after + str.charAt(i);
		}
			str = after + before;

	return str;
}

}