import java.util.Scanner;

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

	int taro=0,hanako=0;
	int n = in.nextInt();
	String taro_str,hanako_str;
	int x;
	for(int i=0;i<n;i++){
	    taro_str = in.next();
	    hanako_str = in.next();

	    
	    x=taro_str.compareTo(hanako_str);
	    if(x<0)hanako+=3;
	    else if(x>0)taro+=3;
	    else {
		hanako++;
		taro++;
	    }

	}
	System.out.println(taro + " " + hanako);

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

	int taro=0,hanako=0;
	int n = in.nextInt();
	String taro_str,hanako_str;
	int x;
	for(int i=0;i<n;i++){
	    taro_str = in.next();
	    hanako_str = in.next();

	    
	    x=taro_str.compareTo(hanako_str);
	    if(x<0)hanako+=3;
	    else if(x>0)taro+=3;
	    else {
		hanako++;
		taro++;
	    }

	}
	System.out.println(taro + " " + hanako);

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

	int taro=0,hanako=0;
	int n = in.nextInt();
	String taro_str,hanako_str;
	int x;
	for(int i=0;i<n;i++){
	    taro_str = in.next();
	    hanako_str = in.next();

	    
	    x=taro_str.compareTo(hanako_str);
	    if(x<0)hanako+=3;
	    else if(x>0)taro+=3;
	    else {
		hanako++;
		taro++;
	    }

	}
	System.out.println(taro + " " + hanako);

    } main {
	Scanner in = new Scanner(System.in);

	int taro=0,hanako=0;
	int n = in.nextInt();
	String taro_str,hanako_str;
	int x;
	for(int i=0;i<n;i++){
	    taro_str = in.next();
	    hanako_str = in.next();

	    
	    x=taro_str.compareTo(hanako_str);
	    if(x<0)hanako+=3;
	    else if(x>0)taro+=3;
	    else {
		hanako++;
		taro++;
	    }

	}
	System.out.println(taro + " " + hanako);

    } Scanner in = new Scanner(System.in); in new Scanner(System.in) int taro=0 taro 0 hanako=0; hanako 0 int n = in.nextInt(); n in.nextInt() in.nextInt in String taro_str taro_str hanako_str; hanako_str int x; x for(int i=0;i<n;i++){
	    taro_str = in.next();
	    hanako_str = in.next();

	    
	    x=taro_str.compareTo(hanako_str);
	    if(x<0)hanako+=3;
	    else if(x>0)taro+=3;
	    else {
		hanako++;
		taro++;
	    }

	} int i=0; int i=0; i 0 i<n i n i++ i++ i {
	    taro_str = in.next();
	    hanako_str = in.next();

	    
	    x=taro_str.compareTo(hanako_str);
	    if(x<0)hanako+=3;
	    else if(x>0)taro+=3;
	    else {
		hanako++;
		taro++;
	    }

	} {
	    taro_str = in.next();
	    hanako_str = in.next();

	    
	    x=taro_str.compareTo(hanako_str);
	    if(x<0)hanako+=3;
	    else if(x>0)taro+=3;
	    else {
		hanako++;
		taro++;
	    }

	} taro_str = in.next() taro_str in.next() in.next in hanako_str = in.next() hanako_str in.next() in.next in x=taro_str.compareTo(hanako_str) x taro_str.compareTo(hanako_str) taro_str.compareTo taro_str hanako_str if(x<0)hanako+=3;
	    else if(x>0)taro+=3;
	    else {
		hanako++;
		taro++;
	    } x<0 x 0 hanako+=3 hanako 3 if(x>0)taro+=3;
	    else {
		hanako++;
		taro++;
	    } x>0 x 0 taro+=3 taro 3 {
		hanako++;
		taro++;
	    } hanako++ hanako taro++ taro System.out.println(taro + " " + hanako) System.out.println System.out System System.out taro + " " + hanako taro + " " + hanako taro " " hanako String[] args args public class Main{
    public static void main(String[] args){
	Scanner in = new Scanner(System.in);

	int taro=0,hanako=0;
	int n = in.nextInt();
	String taro_str,hanako_str;
	int x;
	for(int i=0;i<n;i++){
	    taro_str = in.next();
	    hanako_str = in.next();

	    
	    x=taro_str.compareTo(hanako_str);
	    if(x<0)hanako+=3;
	    else if(x>0)taro+=3;
	    else {
		hanako++;
		taro++;
	    }

	}
	System.out.println(taro + " " + hanako);

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

	int taro=0,hanako=0;
	int n = in.nextInt();
	String taro_str,hanako_str;
	int x;
	for(int i=0;i<n;i++){
	    taro_str = in.next();
	    hanako_str = in.next();

	    
	    x=taro_str.compareTo(hanako_str);
	    if(x<0)hanako+=3;
	    else if(x>0)taro+=3;
	    else {
		hanako++;
		taro++;
	    }

	}
	System.out.println(taro + " " + hanako);

    }
} Main
import java.util.Scanner;

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

	int taro=0,hanako=0;
	int n = in.nextInt();
	String taro_str,hanako_str;
	int x;
	for(int i=0;i<n;i++){
	    taro_str = in.next();
	    hanako_str = in.next();

	    
	    x=taro_str.compareTo(hanako_str);
	    if(x<0)hanako+=3;
	    else if(x>0)taro+=3;
	    else {
		hanako++;
		taro++;
	    }

	}
	System.out.println(taro + " " + hanako);

    }
}
	
