import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int scoa1=0,scoa2=0;
        String data[] = new String[2];

        int n=sc.nextInt();
        for(int i=0;i<n;i++){
        	data[0] = sc.next();
        	data[1] = sc.next();
        	if(data[0].compareTo(data[1])<=-1){
        		scoa1+=3;
        	}
        	else if(data[0].compareTo(data[1])>=1){
        		scoa2+=3;
        	}
        	else if(data[0].compareTo(data[1])==0){
        		scoa1++;scoa2++;
        	}
        	else{
        		System.out.println("EEE");
        	}
        }
        System.out.println(scoa2+" "+scoa1);
        sc.close();
    }
} import java.util.Scanner; Scanner java.util public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int scoa1=0,scoa2=0;
        String data[] = new String[2];

        int n=sc.nextInt();
        for(int i=0;i<n;i++){
        	data[0] = sc.next();
        	data[1] = sc.next();
        	if(data[0].compareTo(data[1])<=-1){
        		scoa1+=3;
        	}
        	else if(data[0].compareTo(data[1])>=1){
        		scoa2+=3;
        	}
        	else if(data[0].compareTo(data[1])==0){
        		scoa1++;scoa2++;
        	}
        	else{
        		System.out.println("EEE");
        	}
        }
        System.out.println(scoa2+" "+scoa1);
        sc.close();
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int scoa1=0,scoa2=0;
        String data[] = new String[2];

        int n=sc.nextInt();
        for(int i=0;i<n;i++){
        	data[0] = sc.next();
        	data[1] = sc.next();
        	if(data[0].compareTo(data[1])<=-1){
        		scoa1+=3;
        	}
        	else if(data[0].compareTo(data[1])>=1){
        		scoa2+=3;
        	}
        	else if(data[0].compareTo(data[1])==0){
        		scoa1++;scoa2++;
        	}
        	else{
        		System.out.println("EEE");
        	}
        }
        System.out.println(scoa2+" "+scoa1);
        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);
        int scoa1=0,scoa2=0;
        String data[] = new String[2];

        int n=sc.nextInt();
        for(int i=0;i<n;i++){
        	data[0] = sc.next();
        	data[1] = sc.next();
        	if(data[0].compareTo(data[1])<=-1){
        		scoa1+=3;
        	}
        	else if(data[0].compareTo(data[1])>=1){
        		scoa2+=3;
        	}
        	else if(data[0].compareTo(data[1])==0){
        		scoa1++;scoa2++;
        	}
        	else{
        		System.out.println("EEE");
        	}
        }
        System.out.println(scoa2+" "+scoa1);
        sc.close();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int scoa1=0 scoa1 0 scoa2=0; scoa2 0 String data[] = new String[2]; data new String[2] 2 int n=sc.nextInt(); n sc.nextInt() sc.nextInt sc for(int i=0;i<n;i++){
        	data[0] = sc.next();
        	data[1] = sc.next();
        	if(data[0].compareTo(data[1])<=-1){
        		scoa1+=3;
        	}
        	else if(data[0].compareTo(data[1])>=1){
        		scoa2+=3;
        	}
        	else if(data[0].compareTo(data[1])==0){
        		scoa1++;scoa2++;
        	}
        	else{
        		System.out.println("EEE");
        	}
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
        	data[0] = sc.next();
        	data[1] = sc.next();
        	if(data[0].compareTo(data[1])<=-1){
        		scoa1+=3;
        	}
        	else if(data[0].compareTo(data[1])>=1){
        		scoa2+=3;
        	}
        	else if(data[0].compareTo(data[1])==0){
        		scoa1++;scoa2++;
        	}
        	else{
        		System.out.println("EEE");
        	}
        } {
        	data[0] = sc.next();
        	data[1] = sc.next();
        	if(data[0].compareTo(data[1])<=-1){
        		scoa1+=3;
        	}
        	else if(data[0].compareTo(data[1])>=1){
        		scoa2+=3;
        	}
        	else if(data[0].compareTo(data[1])==0){
        		scoa1++;scoa2++;
        	}
        	else{
        		System.out.println("EEE");
        	}
        } data[0] = sc.next() data[0] data 0 sc.next() sc.next sc data[1] = sc.next() data[1] data 1 sc.next() sc.next sc if(data[0].compareTo(data[1])<=-1){
        		scoa1+=3;
        	}
        	else if(data[0].compareTo(data[1])>=1){
        		scoa2+=3;
        	}
        	else if(data[0].compareTo(data[1])==0){
        		scoa1++;scoa2++;
        	}
        	else{
        		System.out.println("EEE");
        	} data[0].compareTo(data[1])<=-1 data[0].compareTo(data[1]) data[0].compareTo data[0] data 0 data[1] data 1 -1 1 {
        		scoa1+=3;
        	} scoa1+=3 scoa1 3 if(data[0].compareTo(data[1])>=1){
        		scoa2+=3;
        	}
        	else if(data[0].compareTo(data[1])==0){
        		scoa1++;scoa2++;
        	}
        	else{
        		System.out.println("EEE");
        	} data[0].compareTo(data[1])>=1 data[0].compareTo(data[1]) data[0].compareTo data[0] data 0 data[1] data 1 1 {
        		scoa2+=3;
        	} scoa2+=3 scoa2 3 if(data[0].compareTo(data[1])==0){
        		scoa1++;scoa2++;
        	}
        	else{
        		System.out.println("EEE");
        	} data[0].compareTo(data[1])==0 data[0].compareTo(data[1]) data[0].compareTo data[0] data 0 data[1] data 1 0 {
        		scoa1++;scoa2++;
        	} scoa1++ scoa1 scoa2++ scoa2 {
        		System.out.println("EEE");
        	} System.out.println("EEE") System.out.println System.out System System.out "EEE" System.out.println(scoa2+" "+scoa1) System.out.println System.out System System.out scoa2+" "+scoa1 scoa2+" "+scoa1 scoa2 " " scoa1 sc.close() sc.close sc String[] args args public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int scoa1=0,scoa2=0;
        String data[] = new String[2];

        int n=sc.nextInt();
        for(int i=0;i<n;i++){
        	data[0] = sc.next();
        	data[1] = sc.next();
        	if(data[0].compareTo(data[1])<=-1){
        		scoa1+=3;
        	}
        	else if(data[0].compareTo(data[1])>=1){
        		scoa2+=3;
        	}
        	else if(data[0].compareTo(data[1])==0){
        		scoa1++;scoa2++;
        	}
        	else{
        		System.out.println("EEE");
        	}
        }
        System.out.println(scoa2+" "+scoa1);
        sc.close();
    }
} public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int scoa1=0,scoa2=0;
        String data[] = new String[2];

        int n=sc.nextInt();
        for(int i=0;i<n;i++){
        	data[0] = sc.next();
        	data[1] = sc.next();
        	if(data[0].compareTo(data[1])<=-1){
        		scoa1+=3;
        	}
        	else if(data[0].compareTo(data[1])>=1){
        		scoa2+=3;
        	}
        	else if(data[0].compareTo(data[1])==0){
        		scoa1++;scoa2++;
        	}
        	else{
        		System.out.println("EEE");
        	}
        }
        System.out.println(scoa2+" "+scoa1);
        sc.close();
    }
} Main
import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int scoa1=0,scoa2=0;
        String data[] = new String[2];

        int n=sc.nextInt();
        for(int i=0;i<n;i++){
        	data[0] = sc.next();
        	data[1] = sc.next();
        	if(data[0].compareTo(data[1])<=-1){
        		scoa1+=3;
        	}
        	else if(data[0].compareTo(data[1])>=1){
        		scoa2+=3;
        	}
        	else if(data[0].compareTo(data[1])==0){
        		scoa1++;scoa2++;
        	}
        	else{
        		System.out.println("EEE");
        	}
        }
        System.out.println(scoa2+" "+scoa1);
        sc.close();
    }
}
