import java.util.Scanner;

class Main{
       public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
    	int turn;
    	int Taro_Point = 0;
    	int Hanako_Point = 0;
    	int compare;
    	
    	turn = scan.nextInt();
    	String[] Taro_Card= new String[turn];
    	String[] Hanako_Card= new String[turn];
    	
    	for(int i = 0; i < turn; i++){
    		Taro_Card[i] = scan.next();
    		Hanako_Card[i] = scan.next();
    		
    		compare = Taro_Card[i].compareTo(Hanako_Card[i]);
    		
    		if(compare > 0){
    			Taro_Point += 3;
    		}else if(compare == 0){
    			Taro_Point++;
    			Hanako_Point++;
    		}else{
    			Hanako_Point += 3;
    		}
    		
    	}
    	
    	System.out.println(Taro_Point + " " + Hanako_Point);
     }
} import java.util.Scanner; Scanner java.util class Main{
       public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
    	int turn;
    	int Taro_Point = 0;
    	int Hanako_Point = 0;
    	int compare;
    	
    	turn = scan.nextInt();
    	String[] Taro_Card= new String[turn];
    	String[] Hanako_Card= new String[turn];
    	
    	for(int i = 0; i < turn; i++){
    		Taro_Card[i] = scan.next();
    		Hanako_Card[i] = scan.next();
    		
    		compare = Taro_Card[i].compareTo(Hanako_Card[i]);
    		
    		if(compare > 0){
    			Taro_Point += 3;
    		}else if(compare == 0){
    			Taro_Point++;
    			Hanako_Point++;
    		}else{
    			Hanako_Point += 3;
    		}
    		
    	}
    	
    	System.out.println(Taro_Point + " " + Hanako_Point);
     }
} Main public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
    	int turn;
    	int Taro_Point = 0;
    	int Hanako_Point = 0;
    	int compare;
    	
    	turn = scan.nextInt();
    	String[] Taro_Card= new String[turn];
    	String[] Hanako_Card= new String[turn];
    	
    	for(int i = 0; i < turn; i++){
    		Taro_Card[i] = scan.next();
    		Hanako_Card[i] = scan.next();
    		
    		compare = Taro_Card[i].compareTo(Hanako_Card[i]);
    		
    		if(compare > 0){
    			Taro_Point += 3;
    		}else if(compare == 0){
    			Taro_Point++;
    			Hanako_Point++;
    		}else{
    			Hanako_Point += 3;
    		}
    		
    	}
    	
    	System.out.println(Taro_Point + " " + Hanako_Point);
     } main {
    	Scanner scan = new Scanner(System.in);
    	int turn;
    	int Taro_Point = 0;
    	int Hanako_Point = 0;
    	int compare;
    	
    	turn = scan.nextInt();
    	String[] Taro_Card= new String[turn];
    	String[] Hanako_Card= new String[turn];
    	
    	for(int i = 0; i < turn; i++){
    		Taro_Card[i] = scan.next();
    		Hanako_Card[i] = scan.next();
    		
    		compare = Taro_Card[i].compareTo(Hanako_Card[i]);
    		
    		if(compare > 0){
    			Taro_Point += 3;
    		}else if(compare == 0){
    			Taro_Point++;
    			Hanako_Point++;
    		}else{
    			Hanako_Point += 3;
    		}
    		
    	}
    	
    	System.out.println(Taro_Point + " " + Hanako_Point);
     } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int turn; turn int Taro_Point = 0; Taro_Point 0 int Hanako_Point = 0; Hanako_Point 0 int compare; compare turn = scan.nextInt() turn scan.nextInt() scan.nextInt scan String[] Taro_Card= new String[turn]; Taro_Card new String[turn] turn String[] Hanako_Card= new String[turn]; Hanako_Card new String[turn] turn for(int i = 0; i < turn; i++){
    		Taro_Card[i] = scan.next();
    		Hanako_Card[i] = scan.next();
    		
    		compare = Taro_Card[i].compareTo(Hanako_Card[i]);
    		
    		if(compare > 0){
    			Taro_Point += 3;
    		}else if(compare == 0){
    			Taro_Point++;
    			Hanako_Point++;
    		}else{
    			Hanako_Point += 3;
    		}
    		
    	} int i = 0; int i = 0; i 0 i < turn i turn i++ i++ i {
    		Taro_Card[i] = scan.next();
    		Hanako_Card[i] = scan.next();
    		
    		compare = Taro_Card[i].compareTo(Hanako_Card[i]);
    		
    		if(compare > 0){
    			Taro_Point += 3;
    		}else if(compare == 0){
    			Taro_Point++;
    			Hanako_Point++;
    		}else{
    			Hanako_Point += 3;
    		}
    		
    	} {
    		Taro_Card[i] = scan.next();
    		Hanako_Card[i] = scan.next();
    		
    		compare = Taro_Card[i].compareTo(Hanako_Card[i]);
    		
    		if(compare > 0){
    			Taro_Point += 3;
    		}else if(compare == 0){
    			Taro_Point++;
    			Hanako_Point++;
    		}else{
    			Hanako_Point += 3;
    		}
    		
    	} Taro_Card[i] = scan.next() Taro_Card[i] Taro_Card i scan.next() scan.next scan Hanako_Card[i] = scan.next() Hanako_Card[i] Hanako_Card i scan.next() scan.next scan compare = Taro_Card[i].compareTo(Hanako_Card[i]) compare Taro_Card[i].compareTo(Hanako_Card[i]) Taro_Card[i].compareTo Taro_Card[i] Taro_Card i Hanako_Card[i] Hanako_Card i if(compare > 0){
    			Taro_Point += 3;
    		}else if(compare == 0){
    			Taro_Point++;
    			Hanako_Point++;
    		}else{
    			Hanako_Point += 3;
    		} compare > 0 compare 0 {
    			Taro_Point += 3;
    		} Taro_Point += 3 Taro_Point 3 if(compare == 0){
    			Taro_Point++;
    			Hanako_Point++;
    		}else{
    			Hanako_Point += 3;
    		} compare == 0 compare 0 {
    			Taro_Point++;
    			Hanako_Point++;
    		} Taro_Point++ Taro_Point Hanako_Point++ Hanako_Point {
    			Hanako_Point += 3;
    		} Hanako_Point += 3 Hanako_Point 3 System.out.println(Taro_Point + " " + Hanako_Point) System.out.println System.out System System.out Taro_Point + " " + Hanako_Point Taro_Point + " " + Hanako_Point Taro_Point " " Hanako_Point String[] args args
import java.util.Scanner;

class Main{
       public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
    	int turn;
    	int Taro_Point = 0;
    	int Hanako_Point = 0;
    	int compare;
    	
    	turn = scan.nextInt();
    	String[] Taro_Card= new String[turn];
    	String[] Hanako_Card= new String[turn];
    	
    	for(int i = 0; i < turn; i++){
    		Taro_Card[i] = scan.next();
    		Hanako_Card[i] = scan.next();
    		
    		compare = Taro_Card[i].compareTo(Hanako_Card[i]);
    		
    		if(compare > 0){
    			Taro_Point += 3;
    		}else if(compare == 0){
    			Taro_Point++;
    			Hanako_Point++;
    		}else{
    			Hanako_Point += 3;
    		}
    		
    	}
    	
    	System.out.println(Taro_Point + " " + Hanako_Point);
     }
}