import java.util.Scanner;

class Main {
    public static void main(String [] args){
         
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();//????????° & ???????????°
        
        int tarou = 0;
        int hanako = 0;
        
        //String[] ba = new String[2];
       
        for( int i = 0 ; i < n ; i++ ){
        	
        	/*String tehuda = sc.nextLine();//?????????????????????????????±????????????????????????cat dog
        	
        	String[] ba = tehuda.split(" ");//????????§??????????????????????????????????´?
        	
        	if( ba[0].compareToIgnoreCase(ba[1]) > 0 ) {
        		tarou = tarou + 3;
        	}else if( ba[0].compareToIgnoreCase(ba[1]) < 0 ){
        		hanako = hanako + 3;
        	}else if( ba[0].compareToIgnoreCase(ba[1]) == 0 ){
        		tarou++;
        		hanako++;
        	}*/
        	
        	String[] ba = new String[2];
        	
        	for(int j = 0 ; j < 2 ; j++){
        		ba[j] = sc.next();
        	}
        	
        	if( ba[0].compareToIgnoreCase(ba[1]) > 0 ) {
        		tarou = tarou + 3;
        	}else if( ba[0].compareToIgnoreCase(ba[1]) < 0 ){
        		hanako = hanako + 3;
        	}else if( ba[0].compareToIgnoreCase(ba[1]) == 0 ){
        		tarou++;
        		hanako++;
        	}
        	
        }
        
        System.out.println(tarou + " " + hanako);
        
    }
} import java.util.Scanner; Scanner java.util class Main {
    public static void main(String [] args){
         
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();//????????° & ???????????°
        
        int tarou = 0;
        int hanako = 0;
        
        //String[] ba = new String[2];
       
        for( int i = 0 ; i < n ; i++ ){
        	
        	/*String tehuda = sc.nextLine();//?????????????????????????????±????????????????????????cat dog
        	
        	String[] ba = tehuda.split(" ");//????????§??????????????????????????????????´?
        	
        	if( ba[0].compareToIgnoreCase(ba[1]) > 0 ) {
        		tarou = tarou + 3;
        	}else if( ba[0].compareToIgnoreCase(ba[1]) < 0 ){
        		hanako = hanako + 3;
        	}else if( ba[0].compareToIgnoreCase(ba[1]) == 0 ){
        		tarou++;
        		hanako++;
        	}*/
        	
        	String[] ba = new String[2];
        	
        	for(int j = 0 ; j < 2 ; j++){
        		ba[j] = sc.next();
        	}
        	
        	if( ba[0].compareToIgnoreCase(ba[1]) > 0 ) {
        		tarou = tarou + 3;
        	}else if( ba[0].compareToIgnoreCase(ba[1]) < 0 ){
        		hanako = hanako + 3;
        	}else if( ba[0].compareToIgnoreCase(ba[1]) == 0 ){
        		tarou++;
        		hanako++;
        	}
        	
        }
        
        System.out.println(tarou + " " + hanako);
        
    }
} Main public static void main(String [] args){
         
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();//????????° & ???????????°
        
        int tarou = 0;
        int hanako = 0;
        
        //String[] ba = new String[2];
       
        for( int i = 0 ; i < n ; i++ ){
        	
        	/*String tehuda = sc.nextLine();//?????????????????????????????±????????????????????????cat dog
        	
        	String[] ba = tehuda.split(" ");//????????§??????????????????????????????????´?
        	
        	if( ba[0].compareToIgnoreCase(ba[1]) > 0 ) {
        		tarou = tarou + 3;
        	}else if( ba[0].compareToIgnoreCase(ba[1]) < 0 ){
        		hanako = hanako + 3;
        	}else if( ba[0].compareToIgnoreCase(ba[1]) == 0 ){
        		tarou++;
        		hanako++;
        	}*/
        	
        	String[] ba = new String[2];
        	
        	for(int j = 0 ; j < 2 ; j++){
        		ba[j] = sc.next();
        	}
        	
        	if( ba[0].compareToIgnoreCase(ba[1]) > 0 ) {
        		tarou = tarou + 3;
        	}else if( ba[0].compareToIgnoreCase(ba[1]) < 0 ){
        		hanako = hanako + 3;
        	}else if( ba[0].compareToIgnoreCase(ba[1]) == 0 ){
        		tarou++;
        		hanako++;
        	}
        	
        }
        
        System.out.println(tarou + " " + hanako);
        
    } main {
         
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();//????????° & ???????????°
        
        int tarou = 0;
        int hanako = 0;
        
        //String[] ba = new String[2];
       
        for( int i = 0 ; i < n ; i++ ){
        	
        	/*String tehuda = sc.nextLine();//?????????????????????????????±????????????????????????cat dog
        	
        	String[] ba = tehuda.split(" ");//????????§??????????????????????????????????´?
        	
        	if( ba[0].compareToIgnoreCase(ba[1]) > 0 ) {
        		tarou = tarou + 3;
        	}else if( ba[0].compareToIgnoreCase(ba[1]) < 0 ){
        		hanako = hanako + 3;
        	}else if( ba[0].compareToIgnoreCase(ba[1]) == 0 ){
        		tarou++;
        		hanako++;
        	}*/
        	
        	String[] ba = new String[2];
        	
        	for(int j = 0 ; j < 2 ; j++){
        		ba[j] = sc.next();
        	}
        	
        	if( ba[0].compareToIgnoreCase(ba[1]) > 0 ) {
        		tarou = tarou + 3;
        	}else if( ba[0].compareToIgnoreCase(ba[1]) < 0 ){
        		hanako = hanako + 3;
        	}else if( ba[0].compareToIgnoreCase(ba[1]) == 0 ){
        		tarou++;
        		hanako++;
        	}
        	
        }
        
        System.out.println(tarou + " " + hanako);
        
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int tarou = 0; tarou 0 int hanako = 0; hanako 0 for( int i = 0 ; i < n ; i++ ){
        	
        	/*String tehuda = sc.nextLine();//?????????????????????????????±????????????????????????cat dog
        	
        	String[] ba = tehuda.split(" ");//????????§??????????????????????????????????´?
        	
        	if( ba[0].compareToIgnoreCase(ba[1]) > 0 ) {
        		tarou = tarou + 3;
        	}else if( ba[0].compareToIgnoreCase(ba[1]) < 0 ){
        		hanako = hanako + 3;
        	}else if( ba[0].compareToIgnoreCase(ba[1]) == 0 ){
        		tarou++;
        		hanako++;
        	}*/
        	
        	String[] ba = new String[2];
        	
        	for(int j = 0 ; j < 2 ; j++){
        		ba[j] = sc.next();
        	}
        	
        	if( ba[0].compareToIgnoreCase(ba[1]) > 0 ) {
        		tarou = tarou + 3;
        	}else if( ba[0].compareToIgnoreCase(ba[1]) < 0 ){
        		hanako = hanako + 3;
        	}else if( ba[0].compareToIgnoreCase(ba[1]) == 0 ){
        		tarou++;
        		hanako++;
        	}
        	
        } int i = 0 ; int i = 0 ; i 0 i < n i n i++ i++ i {
        	
        	/*String tehuda = sc.nextLine();//?????????????????????????????±????????????????????????cat dog
        	
        	String[] ba = tehuda.split(" ");//????????§??????????????????????????????????´?
        	
        	if( ba[0].compareToIgnoreCase(ba[1]) > 0 ) {
        		tarou = tarou + 3;
        	}else if( ba[0].compareToIgnoreCase(ba[1]) < 0 ){
        		hanako = hanako + 3;
        	}else if( ba[0].compareToIgnoreCase(ba[1]) == 0 ){
        		tarou++;
        		hanako++;
        	}*/
        	
        	String[] ba = new String[2];
        	
        	for(int j = 0 ; j < 2 ; j++){
        		ba[j] = sc.next();
        	}
        	
        	if( ba[0].compareToIgnoreCase(ba[1]) > 0 ) {
        		tarou = tarou + 3;
        	}else if( ba[0].compareToIgnoreCase(ba[1]) < 0 ){
        		hanako = hanako + 3;
        	}else if( ba[0].compareToIgnoreCase(ba[1]) == 0 ){
        		tarou++;
        		hanako++;
        	}
        	
        } {
        	
        	/*String tehuda = sc.nextLine();//?????????????????????????????±????????????????????????cat dog
        	
        	String[] ba = tehuda.split(" ");//????????§??????????????????????????????????´?
        	
        	if( ba[0].compareToIgnoreCase(ba[1]) > 0 ) {
        		tarou = tarou + 3;
        	}else if( ba[0].compareToIgnoreCase(ba[1]) < 0 ){
        		hanako = hanako + 3;
        	}else if( ba[0].compareToIgnoreCase(ba[1]) == 0 ){
        		tarou++;
        		hanako++;
        	}*/
        	
        	String[] ba = new String[2];
        	
        	for(int j = 0 ; j < 2 ; j++){
        		ba[j] = sc.next();
        	}
        	
        	if( ba[0].compareToIgnoreCase(ba[1]) > 0 ) {
        		tarou = tarou + 3;
        	}else if( ba[0].compareToIgnoreCase(ba[1]) < 0 ){
        		hanako = hanako + 3;
        	}else if( ba[0].compareToIgnoreCase(ba[1]) == 0 ){
        		tarou++;
        		hanako++;
        	}
        	
        } String[] ba = new String[2]; ba new String[2] 2 for(int j = 0 ; j < 2 ; j++){
        		ba[j] = sc.next();
        	} int j = 0 ; int j = 0 ; j 0 j < 2 j 2 j++ j++ j {
        		ba[j] = sc.next();
        	} {
        		ba[j] = sc.next();
        	} ba[j] = sc.next() ba[j] ba j sc.next() sc.next sc if( ba[0].compareToIgnoreCase(ba[1]) > 0 ) {
        		tarou = tarou + 3;
        	}else if( ba[0].compareToIgnoreCase(ba[1]) < 0 ){
        		hanako = hanako + 3;
        	}else if( ba[0].compareToIgnoreCase(ba[1]) == 0 ){
        		tarou++;
        		hanako++;
        	} ba[0].compareToIgnoreCase(ba[1]) > 0 ba[0].compareToIgnoreCase(ba[1]) ba[0].compareToIgnoreCase ba[0] ba 0 ba[1] ba 1 0 {
        		tarou = tarou + 3;
        	} tarou = tarou + 3 tarou tarou + 3 tarou 3 if( ba[0].compareToIgnoreCase(ba[1]) < 0 ){
        		hanako = hanako + 3;
        	}else if( ba[0].compareToIgnoreCase(ba[1]) == 0 ){
        		tarou++;
        		hanako++;
        	} ba[0].compareToIgnoreCase(ba[1]) < 0 ba[0].compareToIgnoreCase(ba[1]) ba[0].compareToIgnoreCase ba[0] ba 0 ba[1] ba 1 0 {
        		hanako = hanako + 3;
        	} hanako = hanako + 3 hanako hanako + 3 hanako 3 if( ba[0].compareToIgnoreCase(ba[1]) == 0 ){
        		tarou++;
        		hanako++;
        	} ba[0].compareToIgnoreCase(ba[1]) == 0 ba[0].compareToIgnoreCase(ba[1]) ba[0].compareToIgnoreCase ba[0] ba 0 ba[1] ba 1 0 {
        		tarou++;
        		hanako++;
        	} tarou++ tarou hanako++ hanako System.out.println(tarou + " " + hanako) System.out.println System.out System System.out tarou + " " + hanako tarou + " " + hanako tarou " " hanako String [] args args
import java.util.Scanner;

class Main {
    public static void main(String [] args){
         
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();//????????° & ???????????°
        
        int tarou = 0;
        int hanako = 0;
        
        //String[] ba = new String[2];
       
        for( int i = 0 ; i < n ; i++ ){
        	
        	/*String tehuda = sc.nextLine();//?????????????????????????????±????????????????????????cat dog
        	
        	String[] ba = tehuda.split(" ");//????????§??????????????????????????????????´?
        	
        	if( ba[0].compareToIgnoreCase(ba[1]) > 0 ) {
        		tarou = tarou + 3;
        	}else if( ba[0].compareToIgnoreCase(ba[1]) < 0 ){
        		hanako = hanako + 3;
        	}else if( ba[0].compareToIgnoreCase(ba[1]) == 0 ){
        		tarou++;
        		hanako++;
        	}*/
        	
        	String[] ba = new String[2];
        	
        	for(int j = 0 ; j < 2 ; j++){
        		ba[j] = sc.next();
        	}
        	
        	if( ba[0].compareToIgnoreCase(ba[1]) > 0 ) {
        		tarou = tarou + 3;
        	}else if( ba[0].compareToIgnoreCase(ba[1]) < 0 ){
        		hanako = hanako + 3;
        	}else if( ba[0].compareToIgnoreCase(ba[1]) == 0 ){
        		tarou++;
        		hanako++;
        	}
        	
        }
        
        System.out.println(tarou + " " + hanako);
        
    }
}