import java.util.*;

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

        String str = sc.nextLine();
        int n = Integer.parseInt(str);

        int h_point = 0,t_point = 0;

        for(int i = 0;i < n;i++){
            String taro = sc.next();
            String hanako = sc.next();
            if(taro.compareTo(hanako) > 0)  t_point += 3;
            else if(taro.compareTo(hanako) < 0) h_point += 3;
            else{
                t_point++;
                h_point++;
            }
        }
        System.out.println(t_point+" "+h_point);
    }
} import java.util.*; util.* java class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        String str = sc.nextLine();
        int n = Integer.parseInt(str);

        int h_point = 0,t_point = 0;

        for(int i = 0;i < n;i++){
            String taro = sc.next();
            String hanako = sc.next();
            if(taro.compareTo(hanako) > 0)  t_point += 3;
            else if(taro.compareTo(hanako) < 0) h_point += 3;
            else{
                t_point++;
                h_point++;
            }
        }
        System.out.println(t_point+" "+h_point);
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);

        String str = sc.nextLine();
        int n = Integer.parseInt(str);

        int h_point = 0,t_point = 0;

        for(int i = 0;i < n;i++){
            String taro = sc.next();
            String hanako = sc.next();
            if(taro.compareTo(hanako) > 0)  t_point += 3;
            else if(taro.compareTo(hanako) < 0) h_point += 3;
            else{
                t_point++;
                h_point++;
            }
        }
        System.out.println(t_point+" "+h_point);
    } main {
        Scanner sc = new Scanner(System.in);

        String str = sc.nextLine();
        int n = Integer.parseInt(str);

        int h_point = 0,t_point = 0;

        for(int i = 0;i < n;i++){
            String taro = sc.next();
            String hanako = sc.next();
            if(taro.compareTo(hanako) > 0)  t_point += 3;
            else if(taro.compareTo(hanako) < 0) h_point += 3;
            else{
                t_point++;
                h_point++;
            }
        }
        System.out.println(t_point+" "+h_point);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String str = sc.nextLine(); str sc.nextLine() sc.nextLine sc int n = Integer.parseInt(str); n Integer.parseInt(str) Integer.parseInt Integer str int h_point = 0 h_point 0 t_point = 0; t_point 0 for(int i = 0;i < n;i++){
            String taro = sc.next();
            String hanako = sc.next();
            if(taro.compareTo(hanako) > 0)  t_point += 3;
            else if(taro.compareTo(hanako) < 0) h_point += 3;
            else{
                t_point++;
                h_point++;
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            String taro = sc.next();
            String hanako = sc.next();
            if(taro.compareTo(hanako) > 0)  t_point += 3;
            else if(taro.compareTo(hanako) < 0) h_point += 3;
            else{
                t_point++;
                h_point++;
            }
        } {
            String taro = sc.next();
            String hanako = sc.next();
            if(taro.compareTo(hanako) > 0)  t_point += 3;
            else if(taro.compareTo(hanako) < 0) h_point += 3;
            else{
                t_point++;
                h_point++;
            }
        } String taro = sc.next(); taro sc.next() sc.next sc String hanako = sc.next(); hanako sc.next() sc.next sc if(taro.compareTo(hanako) > 0)  t_point += 3;
            else if(taro.compareTo(hanako) < 0) h_point += 3;
            else{
                t_point++;
                h_point++;
            } taro.compareTo(hanako) > 0 taro.compareTo(hanako) taro.compareTo taro hanako 0 t_point += 3 t_point 3 if(taro.compareTo(hanako) < 0) h_point += 3;
            else{
                t_point++;
                h_point++;
            } taro.compareTo(hanako) < 0 taro.compareTo(hanako) taro.compareTo taro hanako 0 h_point += 3 h_point 3 {
                t_point++;
                h_point++;
            } t_point++ t_point h_point++ h_point System.out.println(t_point+" "+h_point) System.out.println System.out System System.out t_point+" "+h_point t_point+" "+h_point t_point " " h_point String[] args args
import java.util.*;

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

        String str = sc.nextLine();
        int n = Integer.parseInt(str);

        int h_point = 0,t_point = 0;

        for(int i = 0;i < n;i++){
            String taro = sc.next();
            String hanako = sc.next();
            if(taro.compareTo(hanako) > 0)  t_point += 3;
            else if(taro.compareTo(hanako) < 0) h_point += 3;
            else{
                t_point++;
                h_point++;
            }
        }
        System.out.println(t_point+" "+h_point);
    }
}
