import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int ans1 = 0, ans2 = 0;
        for(int i = 0; i < n; i++){
            String s = scan.next();
            String t = scan.next();
            int comp = s.compareTo(t);
            //System.out.println(comp);
            if(comp <= -1)ans1 += 3;
            else if(comp >= 1)ans2 += 3;
            else {
                ans1++;
                ans2++;
            }
        }
        System.out.println(ans2 + " " + ans1);
    }
}
 import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int ans1 = 0, ans2 = 0;
        for(int i = 0; i < n; i++){
            String s = scan.next();
            String t = scan.next();
            int comp = s.compareTo(t);
            //System.out.println(comp);
            if(comp <= -1)ans1 += 3;
            else if(comp >= 1)ans2 += 3;
            else {
                ans1++;
                ans2++;
            }
        }
        System.out.println(ans2 + " " + ans1);
    }
} Main public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int ans1 = 0, ans2 = 0;
        for(int i = 0; i < n; i++){
            String s = scan.next();
            String t = scan.next();
            int comp = s.compareTo(t);
            //System.out.println(comp);
            if(comp <= -1)ans1 += 3;
            else if(comp >= 1)ans2 += 3;
            else {
                ans1++;
                ans2++;
            }
        }
        System.out.println(ans2 + " " + ans1);
    } main {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int ans1 = 0, ans2 = 0;
        for(int i = 0; i < n; i++){
            String s = scan.next();
            String t = scan.next();
            int comp = s.compareTo(t);
            //System.out.println(comp);
            if(comp <= -1)ans1 += 3;
            else if(comp >= 1)ans2 += 3;
            else {
                ans1++;
                ans2++;
            }
        }
        System.out.println(ans2 + " " + ans1);
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int ans1 = 0 ans1 0 ans2 = 0; ans2 0 for(int i = 0; i < n; i++){
            String s = scan.next();
            String t = scan.next();
            int comp = s.compareTo(t);
            //System.out.println(comp);
            if(comp <= -1)ans1 += 3;
            else if(comp >= 1)ans2 += 3;
            else {
                ans1++;
                ans2++;
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            String s = scan.next();
            String t = scan.next();
            int comp = s.compareTo(t);
            //System.out.println(comp);
            if(comp <= -1)ans1 += 3;
            else if(comp >= 1)ans2 += 3;
            else {
                ans1++;
                ans2++;
            }
        } {
            String s = scan.next();
            String t = scan.next();
            int comp = s.compareTo(t);
            //System.out.println(comp);
            if(comp <= -1)ans1 += 3;
            else if(comp >= 1)ans2 += 3;
            else {
                ans1++;
                ans2++;
            }
        } String s = scan.next(); s scan.next() scan.next scan String t = scan.next(); t scan.next() scan.next scan int comp = s.compareTo(t); comp s.compareTo(t) s.compareTo s t if(comp <= -1)ans1 += 3;
            else if(comp >= 1)ans2 += 3;
            else {
                ans1++;
                ans2++;
            } comp <= -1 comp -1 1 ans1 += 3 ans1 3 if(comp >= 1)ans2 += 3;
            else {
                ans1++;
                ans2++;
            } comp >= 1 comp 1 ans2 += 3 ans2 3 {
                ans1++;
                ans2++;
            } ans1++ ans1 ans2++ ans2 System.out.println(ans2 + " " + ans1) System.out.println System.out System System.out ans2 + " " + ans1 ans2 + " " + ans1 ans2 " " ans1 String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int ans1 = 0, ans2 = 0;
        for(int i = 0; i < n; i++){
            String s = scan.next();
            String t = scan.next();
            int comp = s.compareTo(t);
            //System.out.println(comp);
            if(comp <= -1)ans1 += 3;
            else if(comp >= 1)ans2 += 3;
            else {
                ans1++;
                ans2++;
            }
        }
        System.out.println(ans2 + " " + ans1);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int ans1 = 0, ans2 = 0;
        for(int i = 0; i < n; i++){
            String s = scan.next();
            String t = scan.next();
            int comp = s.compareTo(t);
            //System.out.println(comp);
            if(comp <= -1)ans1 += 3;
            else if(comp >= 1)ans2 += 3;
            else {
                ans1++;
                ans2++;
            }
        }
        System.out.println(ans2 + " " + ans1);
    }
} Main
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = scan.nextInt();
        int ans1 = 0, ans2 = 0;
        for(int i = 0; i < n; i++){
            String s = scan.next();
            String t = scan.next();
            int comp = s.compareTo(t);
            //System.out.println(comp);
            if(comp <= -1)ans1 += 3;
            else if(comp >= 1)ans2 += 3;
            else {
                ans1++;
                ans2++;
            }
        }
        System.out.println(ans2 + " " + ans1);
    }
}

