import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int i = 0;


        int taro_count = 0;
        int hana_count = 0;
        for (i = 0; i < n; i++) {
            String a = scan.next();
            String b = scan.next();
            if (a.compareTo(b) == 0) {
                taro_count += 1;
                hana_count += 1;
            } else if (a.compareTo(b) < 0) {
                hana_count += 3;
            } else {
                taro_count += 3;
            }
        }
        System.out.println(taro_count + " " + hana_count);
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int i = 0;


        int taro_count = 0;
        int hana_count = 0;
        for (i = 0; i < n; i++) {
            String a = scan.next();
            String b = scan.next();
            if (a.compareTo(b) == 0) {
                taro_count += 1;
                hana_count += 1;
            } else if (a.compareTo(b) < 0) {
                hana_count += 3;
            } else {
                taro_count += 3;
            }
        }
        System.out.println(taro_count + " " + hana_count);
    }
} Main public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int i = 0;


        int taro_count = 0;
        int hana_count = 0;
        for (i = 0; i < n; i++) {
            String a = scan.next();
            String b = scan.next();
            if (a.compareTo(b) == 0) {
                taro_count += 1;
                hana_count += 1;
            } else if (a.compareTo(b) < 0) {
                hana_count += 3;
            } else {
                taro_count += 3;
            }
        }
        System.out.println(taro_count + " " + hana_count);
    } main {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int i = 0;


        int taro_count = 0;
        int hana_count = 0;
        for (i = 0; i < n; i++) {
            String a = scan.next();
            String b = scan.next();
            if (a.compareTo(b) == 0) {
                taro_count += 1;
                hana_count += 1;
            } else if (a.compareTo(b) < 0) {
                hana_count += 3;
            } else {
                taro_count += 3;
            }
        }
        System.out.println(taro_count + " " + hana_count);
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int i = 0; i 0 int taro_count = 0; taro_count 0 int hana_count = 0; hana_count 0 for (i = 0; i < n; i++) {
            String a = scan.next();
            String b = scan.next();
            if (a.compareTo(b) == 0) {
                taro_count += 1;
                hana_count += 1;
            } else if (a.compareTo(b) < 0) {
                hana_count += 3;
            } else {
                taro_count += 3;
            }
        } i = 0; i = 0 i 0 i < n i n i++ i++ i {
            String a = scan.next();
            String b = scan.next();
            if (a.compareTo(b) == 0) {
                taro_count += 1;
                hana_count += 1;
            } else if (a.compareTo(b) < 0) {
                hana_count += 3;
            } else {
                taro_count += 3;
            }
        } {
            String a = scan.next();
            String b = scan.next();
            if (a.compareTo(b) == 0) {
                taro_count += 1;
                hana_count += 1;
            } else if (a.compareTo(b) < 0) {
                hana_count += 3;
            } else {
                taro_count += 3;
            }
        } String a = scan.next(); a scan.next() scan.next scan String b = scan.next(); b scan.next() scan.next scan if (a.compareTo(b) == 0) {
                taro_count += 1;
                hana_count += 1;
            } else if (a.compareTo(b) < 0) {
                hana_count += 3;
            } else {
                taro_count += 3;
            } a.compareTo(b) == 0 a.compareTo(b) a.compareTo a b 0 {
                taro_count += 1;
                hana_count += 1;
            } taro_count += 1 taro_count 1 hana_count += 1 hana_count 1 if (a.compareTo(b) < 0) {
                hana_count += 3;
            } else {
                taro_count += 3;
            } a.compareTo(b) < 0 a.compareTo(b) a.compareTo a b 0 {
                hana_count += 3;
            } hana_count += 3 hana_count 3 {
                taro_count += 3;
            } taro_count += 3 taro_count 3 System.out.println(taro_count + " " + hana_count) System.out.println System.out System System.out taro_count + " " + hana_count taro_count + " " + hana_count taro_count " " hana_count String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int i = 0;


        int taro_count = 0;
        int hana_count = 0;
        for (i = 0; i < n; i++) {
            String a = scan.next();
            String b = scan.next();
            if (a.compareTo(b) == 0) {
                taro_count += 1;
                hana_count += 1;
            } else if (a.compareTo(b) < 0) {
                hana_count += 3;
            } else {
                taro_count += 3;
            }
        }
        System.out.println(taro_count + " " + hana_count);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int i = 0;


        int taro_count = 0;
        int hana_count = 0;
        for (i = 0; i < n; i++) {
            String a = scan.next();
            String b = scan.next();
            if (a.compareTo(b) == 0) {
                taro_count += 1;
                hana_count += 1;
            } else if (a.compareTo(b) < 0) {
                hana_count += 3;
            } else {
                taro_count += 3;
            }
        }
        System.out.println(taro_count + " " + hana_count);
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int i = 0;


        int taro_count = 0;
        int hana_count = 0;
        for (i = 0; i < n; i++) {
            String a = scan.next();
            String b = scan.next();
            if (a.compareTo(b) == 0) {
                taro_count += 1;
                hana_count += 1;
            } else if (a.compareTo(b) < 0) {
                hana_count += 3;
            } else {
                taro_count += 3;
            }
        }
        System.out.println(taro_count + " " + hana_count);
    }
}