
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);

		 
		        int n = scanner.nextInt();
		        int tarop = 0;
		        int hanakop = 0;
		        String tarow;
		        String hanakow;
		 
		        for(int i = 0; i < n; i++){
		            tarow=scanner.next();
		            hanakow=scanner.next();
		            if(tarow.compareTo(hanakow) < 0)  {      hanakop =hanakop+ 3;}
		            else if(tarow.compareTo(hanakow) > 0)   tarop = tarop+3;
		            else {
		                hanakop=hanakop+1;
		                tarop=tarop+1;
		            }
		        }
		 
		        System.out.println(tarop + " " + hanakop);
		    }

}
 import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);

		 
		        int n = scanner.nextInt();
		        int tarop = 0;
		        int hanakop = 0;
		        String tarow;
		        String hanakow;
		 
		        for(int i = 0; i < n; i++){
		            tarow=scanner.next();
		            hanakow=scanner.next();
		            if(tarow.compareTo(hanakow) < 0)  {      hanakop =hanakop+ 3;}
		            else if(tarow.compareTo(hanakow) > 0)   tarop = tarop+3;
		            else {
		                hanakop=hanakop+1;
		                tarop=tarop+1;
		            }
		        }
		 
		        System.out.println(tarop + " " + hanakop);
		    }

} Main public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);

		 
		        int n = scanner.nextInt();
		        int tarop = 0;
		        int hanakop = 0;
		        String tarow;
		        String hanakow;
		 
		        for(int i = 0; i < n; i++){
		            tarow=scanner.next();
		            hanakow=scanner.next();
		            if(tarow.compareTo(hanakow) < 0)  {      hanakop =hanakop+ 3;}
		            else if(tarow.compareTo(hanakow) > 0)   tarop = tarop+3;
		            else {
		                hanakop=hanakop+1;
		                tarop=tarop+1;
		            }
		        }
		 
		        System.out.println(tarop + " " + hanakop);
		    } main {
		Scanner scanner = new Scanner(System.in);

		 
		        int n = scanner.nextInt();
		        int tarop = 0;
		        int hanakop = 0;
		        String tarow;
		        String hanakow;
		 
		        for(int i = 0; i < n; i++){
		            tarow=scanner.next();
		            hanakow=scanner.next();
		            if(tarow.compareTo(hanakow) < 0)  {      hanakop =hanakop+ 3;}
		            else if(tarow.compareTo(hanakow) > 0)   tarop = tarop+3;
		            else {
		                hanakop=hanakop+1;
		                tarop=tarop+1;
		            }
		        }
		 
		        System.out.println(tarop + " " + hanakop);
		    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int n = scanner.nextInt(); n scanner.nextInt() scanner.nextInt scanner int tarop = 0; tarop 0 int hanakop = 0; hanakop 0 String tarow; tarow String hanakow; hanakow for(int i = 0; i < n; i++){
		            tarow=scanner.next();
		            hanakow=scanner.next();
		            if(tarow.compareTo(hanakow) < 0)  {      hanakop =hanakop+ 3;}
		            else if(tarow.compareTo(hanakow) > 0)   tarop = tarop+3;
		            else {
		                hanakop=hanakop+1;
		                tarop=tarop+1;
		            }
		        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
		            tarow=scanner.next();
		            hanakow=scanner.next();
		            if(tarow.compareTo(hanakow) < 0)  {      hanakop =hanakop+ 3;}
		            else if(tarow.compareTo(hanakow) > 0)   tarop = tarop+3;
		            else {
		                hanakop=hanakop+1;
		                tarop=tarop+1;
		            }
		        } {
		            tarow=scanner.next();
		            hanakow=scanner.next();
		            if(tarow.compareTo(hanakow) < 0)  {      hanakop =hanakop+ 3;}
		            else if(tarow.compareTo(hanakow) > 0)   tarop = tarop+3;
		            else {
		                hanakop=hanakop+1;
		                tarop=tarop+1;
		            }
		        } tarow=scanner.next() tarow scanner.next() scanner.next scanner hanakow=scanner.next() hanakow scanner.next() scanner.next scanner if(tarow.compareTo(hanakow) < 0)  {      hanakop =hanakop+ 3;}
		            else if(tarow.compareTo(hanakow) > 0)   tarop = tarop+3;
		            else {
		                hanakop=hanakop+1;
		                tarop=tarop+1;
		            } tarow.compareTo(hanakow) < 0 tarow.compareTo(hanakow) tarow.compareTo tarow hanakow 0 {      hanakop =hanakop+ 3;} hanakop =hanakop+ 3 hanakop hanakop+ 3 hanakop 3 if(tarow.compareTo(hanakow) > 0)   tarop = tarop+3;
		            else {
		                hanakop=hanakop+1;
		                tarop=tarop+1;
		            } tarow.compareTo(hanakow) > 0 tarow.compareTo(hanakow) tarow.compareTo tarow hanakow 0 tarop = tarop+3 tarop tarop+3 tarop 3 {
		                hanakop=hanakop+1;
		                tarop=tarop+1;
		            } hanakop=hanakop+1 hanakop hanakop+1 hanakop 1 tarop=tarop+1 tarop tarop+1 tarop 1 System.out.println(tarop + " " + hanakop) System.out.println System.out System System.out tarop + " " + hanakop tarop + " " + hanakop tarop " " hanakop String[] args args public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);

		 
		        int n = scanner.nextInt();
		        int tarop = 0;
		        int hanakop = 0;
		        String tarow;
		        String hanakow;
		 
		        for(int i = 0; i < n; i++){
		            tarow=scanner.next();
		            hanakow=scanner.next();
		            if(tarow.compareTo(hanakow) < 0)  {      hanakop =hanakop+ 3;}
		            else if(tarow.compareTo(hanakow) > 0)   tarop = tarop+3;
		            else {
		                hanakop=hanakop+1;
		                tarop=tarop+1;
		            }
		        }
		 
		        System.out.println(tarop + " " + hanakop);
		    }

} public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);

		 
		        int n = scanner.nextInt();
		        int tarop = 0;
		        int hanakop = 0;
		        String tarow;
		        String hanakow;
		 
		        for(int i = 0; i < n; i++){
		            tarow=scanner.next();
		            hanakow=scanner.next();
		            if(tarow.compareTo(hanakow) < 0)  {      hanakop =hanakop+ 3;}
		            else if(tarow.compareTo(hanakow) > 0)   tarop = tarop+3;
		            else {
		                hanakop=hanakop+1;
		                tarop=tarop+1;
		            }
		        }
		 
		        System.out.println(tarop + " " + hanakop);
		    }

} Main

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);

		 
		        int n = scanner.nextInt();
		        int tarop = 0;
		        int hanakop = 0;
		        String tarow;
		        String hanakow;
		 
		        for(int i = 0; i < n; i++){
		            tarow=scanner.next();
		            hanakow=scanner.next();
		            if(tarow.compareTo(hanakow) < 0)  {      hanakop =hanakop+ 3;}
		            else if(tarow.compareTo(hanakow) > 0)   tarop = tarop+3;
		            else {
		                hanakop=hanakop+1;
		                tarop=tarop+1;
		            }
		        }
		 
		        System.out.println(tarop + " " + hanakop);
		    }

}

