import java.util.Scanner;

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

        int n = Integer.parseInt(sc.next());

        int taro = 0;
        int hanako = 0;
        for (int i = 0; i < n; i++) {
            String TS = sc.next();
            String HS = sc.next();

            if (TS.compareTo(HS) > 0) {
                taro += 3;
            } else if (TS.compareTo(HS) < 0){
                hanako += 3;
            } else if (TS.compareTo(HS) == 0) {
                taro++;
                hanako++;
            }
        }
        System.out.printf("%d %d\n", taro, hanako);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = Integer.parseInt(sc.next());

        int taro = 0;
        int hanako = 0;
        for (int i = 0; i < n; i++) {
            String TS = sc.next();
            String HS = sc.next();

            if (TS.compareTo(HS) > 0) {
                taro += 3;
            } else if (TS.compareTo(HS) < 0){
                hanako += 3;
            } else if (TS.compareTo(HS) == 0) {
                taro++;
                hanako++;
            }
        }
        System.out.printf("%d %d\n", taro, hanako);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = Integer.parseInt(sc.next());

        int taro = 0;
        int hanako = 0;
        for (int i = 0; i < n; i++) {
            String TS = sc.next();
            String HS = sc.next();

            if (TS.compareTo(HS) > 0) {
                taro += 3;
            } else if (TS.compareTo(HS) < 0){
                hanako += 3;
            } else if (TS.compareTo(HS) == 0) {
                taro++;
                hanako++;
            }
        }
        System.out.printf("%d %d\n", taro, hanako);
    } main {
        Scanner sc = new Scanner(System.in);

        int n = Integer.parseInt(sc.next());

        int taro = 0;
        int hanako = 0;
        for (int i = 0; i < n; i++) {
            String TS = sc.next();
            String HS = sc.next();

            if (TS.compareTo(HS) > 0) {
                taro += 3;
            } else if (TS.compareTo(HS) < 0){
                hanako += 3;
            } else if (TS.compareTo(HS) == 0) {
                taro++;
                hanako++;
            }
        }
        System.out.printf("%d %d\n", taro, hanako);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = Integer.parseInt(sc.next()); n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int taro = 0; taro 0 int hanako = 0; hanako 0 for (int i = 0; i < n; i++) {
            String TS = sc.next();
            String HS = sc.next();

            if (TS.compareTo(HS) > 0) {
                taro += 3;
            } else if (TS.compareTo(HS) < 0){
                hanako += 3;
            } else if (TS.compareTo(HS) == 0) {
                taro++;
                hanako++;
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            String TS = sc.next();
            String HS = sc.next();

            if (TS.compareTo(HS) > 0) {
                taro += 3;
            } else if (TS.compareTo(HS) < 0){
                hanako += 3;
            } else if (TS.compareTo(HS) == 0) {
                taro++;
                hanako++;
            }
        } {
            String TS = sc.next();
            String HS = sc.next();

            if (TS.compareTo(HS) > 0) {
                taro += 3;
            } else if (TS.compareTo(HS) < 0){
                hanako += 3;
            } else if (TS.compareTo(HS) == 0) {
                taro++;
                hanako++;
            }
        } String TS = sc.next(); TS sc.next() sc.next sc String HS = sc.next(); HS sc.next() sc.next sc if (TS.compareTo(HS) > 0) {
                taro += 3;
            } else if (TS.compareTo(HS) < 0){
                hanako += 3;
            } else if (TS.compareTo(HS) == 0) {
                taro++;
                hanako++;
            } TS.compareTo(HS) > 0 TS.compareTo(HS) TS.compareTo TS HS 0 {
                taro += 3;
            } taro += 3 taro 3 if (TS.compareTo(HS) < 0){
                hanako += 3;
            } else if (TS.compareTo(HS) == 0) {
                taro++;
                hanako++;
            } TS.compareTo(HS) < 0 TS.compareTo(HS) TS.compareTo TS HS 0 {
                hanako += 3;
            } hanako += 3 hanako 3 if (TS.compareTo(HS) == 0) {
                taro++;
                hanako++;
            } TS.compareTo(HS) == 0 TS.compareTo(HS) TS.compareTo TS HS 0 {
                taro++;
                hanako++;
            } taro++ taro hanako++ hanako System.out.printf("%d %d\n", taro, hanako) System.out.printf System.out System System.out "%d %d\n" taro hanako String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = Integer.parseInt(sc.next());

        int taro = 0;
        int hanako = 0;
        for (int i = 0; i < n; i++) {
            String TS = sc.next();
            String HS = sc.next();

            if (TS.compareTo(HS) > 0) {
                taro += 3;
            } else if (TS.compareTo(HS) < 0){
                hanako += 3;
            } else if (TS.compareTo(HS) == 0) {
                taro++;
                hanako++;
            }
        }
        System.out.printf("%d %d\n", taro, hanako);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int n = Integer.parseInt(sc.next());

        int taro = 0;
        int hanako = 0;
        for (int i = 0; i < n; i++) {
            String TS = sc.next();
            String HS = sc.next();

            if (TS.compareTo(HS) > 0) {
                taro += 3;
            } else if (TS.compareTo(HS) < 0){
                hanako += 3;
            } else if (TS.compareTo(HS) == 0) {
                taro++;
                hanako++;
            }
        }
        System.out.printf("%d %d\n", taro, hanako);
    }
} Main
import java.util.Scanner;

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

        int n = Integer.parseInt(sc.next());

        int taro = 0;
        int hanako = 0;
        for (int i = 0; i < n; i++) {
            String TS = sc.next();
            String HS = sc.next();

            if (TS.compareTo(HS) > 0) {
                taro += 3;
            } else if (TS.compareTo(HS) < 0){
                hanako += 3;
            } else if (TS.compareTo(HS) == 0) {
                taro++;
                hanako++;
            }
        }
        System.out.printf("%d %d\n", taro, hanako);
    }
}