import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int num = Integer.parseInt(scan.next());
        int taroScore = 0, hanakoScore = 0;

        for (int i = 0; i < num; i++) {
            String taroS = scan.next(), hanakoS = scan.next();
            int comp = taroS.compareTo(hanakoS);

            if (comp > 0) {
                taroScore += 3;
            } else if (comp < 0) {
                hanakoScore += 3;
            } else {
                taroScore++;
                hanakoScore++;
            }
        }

        System.out.println(taroScore + " " + hanakoScore);
    }
}
 import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int num = Integer.parseInt(scan.next());
        int taroScore = 0, hanakoScore = 0;

        for (int i = 0; i < num; i++) {
            String taroS = scan.next(), hanakoS = scan.next();
            int comp = taroS.compareTo(hanakoS);

            if (comp > 0) {
                taroScore += 3;
            } else if (comp < 0) {
                hanakoScore += 3;
            } else {
                taroScore++;
                hanakoScore++;
            }
        }

        System.out.println(taroScore + " " + hanakoScore);
    }
} Main public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int num = Integer.parseInt(scan.next());
        int taroScore = 0, hanakoScore = 0;

        for (int i = 0; i < num; i++) {
            String taroS = scan.next(), hanakoS = scan.next();
            int comp = taroS.compareTo(hanakoS);

            if (comp > 0) {
                taroScore += 3;
            } else if (comp < 0) {
                hanakoScore += 3;
            } else {
                taroScore++;
                hanakoScore++;
            }
        }

        System.out.println(taroScore + " " + hanakoScore);
    } main {
        Scanner scan = new Scanner(System.in);
        int num = Integer.parseInt(scan.next());
        int taroScore = 0, hanakoScore = 0;

        for (int i = 0; i < num; i++) {
            String taroS = scan.next(), hanakoS = scan.next();
            int comp = taroS.compareTo(hanakoS);

            if (comp > 0) {
                taroScore += 3;
            } else if (comp < 0) {
                hanakoScore += 3;
            } else {
                taroScore++;
                hanakoScore++;
            }
        }

        System.out.println(taroScore + " " + hanakoScore);
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int num = Integer.parseInt(scan.next()); num Integer.parseInt(scan.next()) Integer.parseInt Integer scan.next() scan.next scan int taroScore = 0 taroScore 0 hanakoScore = 0; hanakoScore 0 for (int i = 0; i < num; i++) {
            String taroS = scan.next(), hanakoS = scan.next();
            int comp = taroS.compareTo(hanakoS);

            if (comp > 0) {
                taroScore += 3;
            } else if (comp < 0) {
                hanakoScore += 3;
            } else {
                taroScore++;
                hanakoScore++;
            }
        } int i = 0; int i = 0; i 0 i < num i num i++ i++ i {
            String taroS = scan.next(), hanakoS = scan.next();
            int comp = taroS.compareTo(hanakoS);

            if (comp > 0) {
                taroScore += 3;
            } else if (comp < 0) {
                hanakoScore += 3;
            } else {
                taroScore++;
                hanakoScore++;
            }
        } {
            String taroS = scan.next(), hanakoS = scan.next();
            int comp = taroS.compareTo(hanakoS);

            if (comp > 0) {
                taroScore += 3;
            } else if (comp < 0) {
                hanakoScore += 3;
            } else {
                taroScore++;
                hanakoScore++;
            }
        } String taroS = scan.next() taroS scan.next() scan.next scan hanakoS = scan.next(); hanakoS scan.next() scan.next scan int comp = taroS.compareTo(hanakoS); comp taroS.compareTo(hanakoS) taroS.compareTo taroS hanakoS if (comp > 0) {
                taroScore += 3;
            } else if (comp < 0) {
                hanakoScore += 3;
            } else {
                taroScore++;
                hanakoScore++;
            } comp > 0 comp 0 {
                taroScore += 3;
            } taroScore += 3 taroScore 3 if (comp < 0) {
                hanakoScore += 3;
            } else {
                taroScore++;
                hanakoScore++;
            } comp < 0 comp 0 {
                hanakoScore += 3;
            } hanakoScore += 3 hanakoScore 3 {
                taroScore++;
                hanakoScore++;
            } taroScore++ taroScore hanakoScore++ hanakoScore System.out.println(taroScore + " " + hanakoScore) System.out.println System.out System System.out taroScore + " " + hanakoScore taroScore + " " + hanakoScore taroScore " " hanakoScore String[] args args public class Main {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int num = Integer.parseInt(scan.next());
        int taroScore = 0, hanakoScore = 0;

        for (int i = 0; i < num; i++) {
            String taroS = scan.next(), hanakoS = scan.next();
            int comp = taroS.compareTo(hanakoS);

            if (comp > 0) {
                taroScore += 3;
            } else if (comp < 0) {
                hanakoScore += 3;
            } else {
                taroScore++;
                hanakoScore++;
            }
        }

        System.out.println(taroScore + " " + hanakoScore);
    }
} public class Main {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int num = Integer.parseInt(scan.next());
        int taroScore = 0, hanakoScore = 0;

        for (int i = 0; i < num; i++) {
            String taroS = scan.next(), hanakoS = scan.next();
            int comp = taroS.compareTo(hanakoS);

            if (comp > 0) {
                taroScore += 3;
            } else if (comp < 0) {
                hanakoScore += 3;
            } else {
                taroScore++;
                hanakoScore++;
            }
        }

        System.out.println(taroScore + " " + hanakoScore);
    }
} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int num = Integer.parseInt(scan.next());
        int taroScore = 0, hanakoScore = 0;

        for (int i = 0; i < num; i++) {
            String taroS = scan.next(), hanakoS = scan.next();
            int comp = taroS.compareTo(hanakoS);

            if (comp > 0) {
                taroScore += 3;
            } else if (comp < 0) {
                hanakoScore += 3;
            } else {
                taroScore++;
                hanakoScore++;
            }
        }

        System.out.println(taroScore + " " + hanakoScore);
    }
}

