import java.io.*;
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
//        sc.useDelimiter(",");
//        DecimalFormat df = new DecimalFormat("0.00000000");
        
        int n = Integer.parseInt(sc.next());
        int taro = 0;
        int hanako = 0;
        for (int i=0; i<n; i++) {
            String s1 = sc.next();
            String s2 = sc.next();
            if (s1.compareTo(s2) == 0) {
                taro++;
                hanako++;
            } else if (s1.compareTo(s2) > 0) {
                taro += 3;
            } else {
                hanako += 3;
            }
        }
        out.println(taro +" "+ hanako);
        out.flush();
    }
} import java.io.*; io.* java import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
//        sc.useDelimiter(",");
//        DecimalFormat df = new DecimalFormat("0.00000000");
        
        int n = Integer.parseInt(sc.next());
        int taro = 0;
        int hanako = 0;
        for (int i=0; i<n; i++) {
            String s1 = sc.next();
            String s2 = sc.next();
            if (s1.compareTo(s2) == 0) {
                taro++;
                hanako++;
            } else if (s1.compareTo(s2) > 0) {
                taro += 3;
            } else {
                hanako += 3;
            }
        }
        out.println(taro +" "+ hanako);
        out.flush();
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
//        sc.useDelimiter(",");
//        DecimalFormat df = new DecimalFormat("0.00000000");
        
        int n = Integer.parseInt(sc.next());
        int taro = 0;
        int hanako = 0;
        for (int i=0; i<n; i++) {
            String s1 = sc.next();
            String s2 = sc.next();
            if (s1.compareTo(s2) == 0) {
                taro++;
                hanako++;
            } else if (s1.compareTo(s2) > 0) {
                taro += 3;
            } else {
                hanako += 3;
            }
        }
        out.println(taro +" "+ hanako);
        out.flush();
    } main {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
//        sc.useDelimiter(",");
//        DecimalFormat df = new DecimalFormat("0.00000000");
        
        int n = Integer.parseInt(sc.next());
        int taro = 0;
        int hanako = 0;
        for (int i=0; i<n; i++) {
            String s1 = sc.next();
            String s2 = sc.next();
            if (s1.compareTo(s2) == 0) {
                taro++;
                hanako++;
            } else if (s1.compareTo(s2) > 0) {
                taro += 3;
            } else {
                hanako += 3;
            }
        }
        out.println(taro +" "+ hanako);
        out.flush();
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) int n = Integer.parseInt(sc.next()); n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int taro = 0; taro 0 int hanako = 0; hanako 0 for (int i=0; i<n; i++) {
            String s1 = sc.next();
            String s2 = sc.next();
            if (s1.compareTo(s2) == 0) {
                taro++;
                hanako++;
            } else if (s1.compareTo(s2) > 0) {
                taro += 3;
            } else {
                hanako += 3;
            }
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            String s1 = sc.next();
            String s2 = sc.next();
            if (s1.compareTo(s2) == 0) {
                taro++;
                hanako++;
            } else if (s1.compareTo(s2) > 0) {
                taro += 3;
            } else {
                hanako += 3;
            }
        } {
            String s1 = sc.next();
            String s2 = sc.next();
            if (s1.compareTo(s2) == 0) {
                taro++;
                hanako++;
            } else if (s1.compareTo(s2) > 0) {
                taro += 3;
            } else {
                hanako += 3;
            }
        } String s1 = sc.next(); s1 sc.next() sc.next sc String s2 = sc.next(); s2 sc.next() sc.next sc if (s1.compareTo(s2) == 0) {
                taro++;
                hanako++;
            } else if (s1.compareTo(s2) > 0) {
                taro += 3;
            } else {
                hanako += 3;
            } s1.compareTo(s2) == 0 s1.compareTo(s2) s1.compareTo s1 s2 0 {
                taro++;
                hanako++;
            } taro++ taro hanako++ hanako if (s1.compareTo(s2) > 0) {
                taro += 3;
            } else {
                hanako += 3;
            } s1.compareTo(s2) > 0 s1.compareTo(s2) s1.compareTo s1 s2 0 {
                taro += 3;
            } taro += 3 taro 3 {
                hanako += 3;
            } hanako += 3 hanako 3 out.println(taro +" "+ hanako) out.println out taro +" "+ hanako taro +" "+ hanako taro " " hanako out.flush() out.flush out String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
//        sc.useDelimiter(",");
//        DecimalFormat df = new DecimalFormat("0.00000000");
        
        int n = Integer.parseInt(sc.next());
        int taro = 0;
        int hanako = 0;
        for (int i=0; i<n; i++) {
            String s1 = sc.next();
            String s2 = sc.next();
            if (s1.compareTo(s2) == 0) {
                taro++;
                hanako++;
            } else if (s1.compareTo(s2) > 0) {
                taro += 3;
            } else {
                hanako += 3;
            }
        }
        out.println(taro +" "+ hanako);
        out.flush();
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
//        sc.useDelimiter(",");
//        DecimalFormat df = new DecimalFormat("0.00000000");
        
        int n = Integer.parseInt(sc.next());
        int taro = 0;
        int hanako = 0;
        for (int i=0; i<n; i++) {
            String s1 = sc.next();
            String s2 = sc.next();
            if (s1.compareTo(s2) == 0) {
                taro++;
                hanako++;
            } else if (s1.compareTo(s2) > 0) {
                taro += 3;
            } else {
                hanako += 3;
            }
        }
        out.println(taro +" "+ hanako);
        out.flush();
    }
} Main
import java.io.*;
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
//        sc.useDelimiter(",");
//        DecimalFormat df = new DecimalFormat("0.00000000");
        
        int n = Integer.parseInt(sc.next());
        int taro = 0;
        int hanako = 0;
        for (int i=0; i<n; i++) {
            String s1 = sc.next();
            String s2 = sc.next();
            if (s1.compareTo(s2) == 0) {
                taro++;
                hanako++;
            } else if (s1.compareTo(s2) > 0) {
                taro += 3;
            } else {
                hanako += 3;
            }
        }
        out.println(taro +" "+ hanako);
        out.flush();
    }
}
