import java.util.Scanner;

public class Main {

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

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int s1 = 0, s2 = 0;
        for (int i = 0; i < n; i++) {
            String[] a = new String[]{sc.next(), sc.next()};
            int z = a[0].compareTo(a[1]);
            if (z > 0) {
                s1 += 3;
            } else if (z < 0) {
                s2 += 3;
            } else {
                s1++;
                s2++;
            }
        }
        System.out.println(s1 + " " + s2);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int s1 = 0, s2 = 0;
        for (int i = 0; i < n; i++) {
            String[] a = new String[]{sc.next(), sc.next()};
            int z = a[0].compareTo(a[1]);
            if (z > 0) {
                s1 += 3;
            } else if (z < 0) {
                s2 += 3;
            } else {
                s1++;
                s2++;
            }
        }
        System.out.println(s1 + " " + s2);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int s1 = 0, s2 = 0;
        for (int i = 0; i < n; i++) {
            String[] a = new String[]{sc.next(), sc.next()};
            int z = a[0].compareTo(a[1]);
            if (z > 0) {
                s1 += 3;
            } else if (z < 0) {
                s2 += 3;
            } else {
                s1++;
                s2++;
            }
        }
        System.out.println(s1 + " " + s2);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int s1 = 0 s1 0 s2 = 0; s2 0 for (int i = 0; i < n; i++) {
            String[] a = new String[]{sc.next(), sc.next()};
            int z = a[0].compareTo(a[1]);
            if (z > 0) {
                s1 += 3;
            } else if (z < 0) {
                s2 += 3;
            } else {
                s1++;
                s2++;
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            String[] a = new String[]{sc.next(), sc.next()};
            int z = a[0].compareTo(a[1]);
            if (z > 0) {
                s1 += 3;
            } else if (z < 0) {
                s2 += 3;
            } else {
                s1++;
                s2++;
            }
        } {
            String[] a = new String[]{sc.next(), sc.next()};
            int z = a[0].compareTo(a[1]);
            if (z > 0) {
                s1 += 3;
            } else if (z < 0) {
                s2 += 3;
            } else {
                s1++;
                s2++;
            }
        } String[] a = new String[]{sc.next(), sc.next()}; a new String[]{sc.next(), sc.next()} int z = a[0].compareTo(a[1]); z a[0].compareTo(a[1]) a[0].compareTo a[0] a 0 a[1] a 1 if (z > 0) {
                s1 += 3;
            } else if (z < 0) {
                s2 += 3;
            } else {
                s1++;
                s2++;
            } z > 0 z 0 {
                s1 += 3;
            } s1 += 3 s1 3 if (z < 0) {
                s2 += 3;
            } else {
                s1++;
                s2++;
            } z < 0 z 0 {
                s2 += 3;
            } s2 += 3 s2 3 {
                s1++;
                s2++;
            } s1++ s1 s2++ s2 System.out.println(s1 + " " + s2) System.out.println System.out System System.out s1 + " " + s2 s1 + " " + s2 s1 " " s2 String[] args args public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int s1 = 0, s2 = 0;
        for (int i = 0; i < n; i++) {
            String[] a = new String[]{sc.next(), sc.next()};
            int z = a[0].compareTo(a[1]);
            if (z > 0) {
                s1 += 3;
            } else if (z < 0) {
                s2 += 3;
            } else {
                s1++;
                s2++;
            }
        }
        System.out.println(s1 + " " + s2);
    }
} public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int s1 = 0, s2 = 0;
        for (int i = 0; i < n; i++) {
            String[] a = new String[]{sc.next(), sc.next()};
            int z = a[0].compareTo(a[1]);
            if (z > 0) {
                s1 += 3;
            } else if (z < 0) {
                s2 += 3;
            } else {
                s1++;
                s2++;
            }
        }
        System.out.println(s1 + " " + s2);
    }
} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int s1 = 0, s2 = 0;
        for (int i = 0; i < n; i++) {
            String[] a = new String[]{sc.next(), sc.next()};
            int z = a[0].compareTo(a[1]);
            if (z > 0) {
                s1 += 3;
            } else if (z < 0) {
                s2 += 3;
            } else {
                s1++;
                s2++;
            }
        }
        System.out.println(s1 + " " + s2);
    }
}