import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        //StringBuilder bd = new StringBuilder();
        ArrayList<String> A = new ArrayList<String>();
        //int[] A = new int[26];
        //Arrays.fill(A, 0);
        //String str;
        int t = 0;
        int h = 0;

        int n = sc.nextInt();

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

            if (taro.compareTo(hanako) > 0) t += 3;
            else if (taro.compareTo(hanako) < 0) h += 3;
            else {t += 1; h += 1;}
        }
        System.out.print(t);
        System.out.print(" ");
        System.out.println(h);

    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        //StringBuilder bd = new StringBuilder();
        ArrayList<String> A = new ArrayList<String>();
        //int[] A = new int[26];
        //Arrays.fill(A, 0);
        //String str;
        int t = 0;
        int h = 0;

        int n = sc.nextInt();

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

            if (taro.compareTo(hanako) > 0) t += 3;
            else if (taro.compareTo(hanako) < 0) h += 3;
            else {t += 1; h += 1;}
        }
        System.out.print(t);
        System.out.print(" ");
        System.out.println(h);

    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        //StringBuilder bd = new StringBuilder();
        ArrayList<String> A = new ArrayList<String>();
        //int[] A = new int[26];
        //Arrays.fill(A, 0);
        //String str;
        int t = 0;
        int h = 0;

        int n = sc.nextInt();

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

            if (taro.compareTo(hanako) > 0) t += 3;
            else if (taro.compareTo(hanako) < 0) h += 3;
            else {t += 1; h += 1;}
        }
        System.out.print(t);
        System.out.print(" ");
        System.out.println(h);

    } main {
        Scanner sc = new Scanner(System.in);
        //StringBuilder bd = new StringBuilder();
        ArrayList<String> A = new ArrayList<String>();
        //int[] A = new int[26];
        //Arrays.fill(A, 0);
        //String str;
        int t = 0;
        int h = 0;

        int n = sc.nextInt();

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

            if (taro.compareTo(hanako) > 0) t += 3;
            else if (taro.compareTo(hanako) < 0) h += 3;
            else {t += 1; h += 1;}
        }
        System.out.print(t);
        System.out.print(" ");
        System.out.println(h);

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) ArrayList<String> A = new ArrayList<String>(); A new ArrayList<String>() int t = 0; t 0 int h = 0; h 0 int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc for (int i=0; i<n; i++) {
            String taro = sc.next();
            String hanako = sc.next();

            if (taro.compareTo(hanako) > 0) t += 3;
            else if (taro.compareTo(hanako) < 0) h += 3;
            else {t += 1; h += 1;}
        } 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 += 3;
            else if (taro.compareTo(hanako) < 0) h += 3;
            else {t += 1; h += 1;}
        } {
            String taro = sc.next();
            String hanako = sc.next();

            if (taro.compareTo(hanako) > 0) t += 3;
            else if (taro.compareTo(hanako) < 0) h += 3;
            else {t += 1; h += 1;}
        } 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 += 3;
            else if (taro.compareTo(hanako) < 0) h += 3;
            else {t += 1; h += 1;} taro.compareTo(hanako) > 0 taro.compareTo(hanako) taro.compareTo taro hanako 0 t += 3 t 3 if (taro.compareTo(hanako) < 0) h += 3;
            else {t += 1; h += 1;} taro.compareTo(hanako) < 0 taro.compareTo(hanako) taro.compareTo taro hanako 0 h += 3 h 3 {t += 1; h += 1;} t += 1 t 1 h += 1 h 1 System.out.print(t) System.out.print System.out System System.out t System.out.print(" ") System.out.print System.out System System.out " " System.out.println(h) System.out.println System.out System System.out h String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        //StringBuilder bd = new StringBuilder();
        ArrayList<String> A = new ArrayList<String>();
        //int[] A = new int[26];
        //Arrays.fill(A, 0);
        //String str;
        int t = 0;
        int h = 0;

        int n = sc.nextInt();

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

            if (taro.compareTo(hanako) > 0) t += 3;
            else if (taro.compareTo(hanako) < 0) h += 3;
            else {t += 1; h += 1;}
        }
        System.out.print(t);
        System.out.print(" ");
        System.out.println(h);

    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        //StringBuilder bd = new StringBuilder();
        ArrayList<String> A = new ArrayList<String>();
        //int[] A = new int[26];
        //Arrays.fill(A, 0);
        //String str;
        int t = 0;
        int h = 0;

        int n = sc.nextInt();

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

            if (taro.compareTo(hanako) > 0) t += 3;
            else if (taro.compareTo(hanako) < 0) h += 3;
            else {t += 1; h += 1;}
        }
        System.out.print(t);
        System.out.print(" ");
        System.out.println(h);

    }
} Main
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        //StringBuilder bd = new StringBuilder();
        ArrayList<String> A = new ArrayList<String>();
        //int[] A = new int[26];
        //Arrays.fill(A, 0);
        //String str;
        int t = 0;
        int h = 0;

        int n = sc.nextInt();

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

            if (taro.compareTo(hanako) > 0) t += 3;
            else if (taro.compareTo(hanako) < 0) h += 3;
            else {t += 1; h += 1;}
        }
        System.out.print(t);
        System.out.print(" ");
        System.out.println(h);

    }
}
