import java.util.*;

public class Main {
    private static final Scanner scn = new Scanner(System.in);
    
    public static void main(String[] args) {
        int t = 0, h = 0, lim = scn.nextInt();
        for(int i = 0; i < lim; i++) {
            int val = scn.next().compareTo(scn.next());
            if(val > 0) {
                t += 3;
            } else if(val < 0) {
                h += 3;
            } else {
                t++;
                h++;
            }
        }
        System.out.println(t + " " + h);
    }
} import java.util.*; util.* java public class Main {
    private static final Scanner scn = new Scanner(System.in);
    
    public static void main(String[] args) {
        int t = 0, h = 0, lim = scn.nextInt();
        for(int i = 0; i < lim; i++) {
            int val = scn.next().compareTo(scn.next());
            if(val > 0) {
                t += 3;
            } else if(val < 0) {
                h += 3;
            } else {
                t++;
                h++;
            }
        }
        System.out.println(t + " " + h);
    }
} Main private static final Scanner scn = new Scanner(System.in); scn new Scanner(System.in) public static void main(String[] args) {
        int t = 0, h = 0, lim = scn.nextInt();
        for(int i = 0; i < lim; i++) {
            int val = scn.next().compareTo(scn.next());
            if(val > 0) {
                t += 3;
            } else if(val < 0) {
                h += 3;
            } else {
                t++;
                h++;
            }
        }
        System.out.println(t + " " + h);
    } main {
        int t = 0, h = 0, lim = scn.nextInt();
        for(int i = 0; i < lim; i++) {
            int val = scn.next().compareTo(scn.next());
            if(val > 0) {
                t += 3;
            } else if(val < 0) {
                h += 3;
            } else {
                t++;
                h++;
            }
        }
        System.out.println(t + " " + h);
    } int t = 0 t 0 h = 0 h 0 lim = scn.nextInt(); lim scn.nextInt() scn.nextInt scn for(int i = 0; i < lim; i++) {
            int val = scn.next().compareTo(scn.next());
            if(val > 0) {
                t += 3;
            } else if(val < 0) {
                h += 3;
            } else {
                t++;
                h++;
            }
        } int i = 0; int i = 0; i 0 i < lim i lim i++ i++ i {
            int val = scn.next().compareTo(scn.next());
            if(val > 0) {
                t += 3;
            } else if(val < 0) {
                h += 3;
            } else {
                t++;
                h++;
            }
        } {
            int val = scn.next().compareTo(scn.next());
            if(val > 0) {
                t += 3;
            } else if(val < 0) {
                h += 3;
            } else {
                t++;
                h++;
            }
        } int val = scn.next().compareTo(scn.next()); val scn.next().compareTo(scn.next()) scn.next().compareTo scn.next() scn.next scn scn.next() scn.next scn if(val > 0) {
                t += 3;
            } else if(val < 0) {
                h += 3;
            } else {
                t++;
                h++;
            } val > 0 val 0 {
                t += 3;
            } t += 3 t 3 if(val < 0) {
                h += 3;
            } else {
                t++;
                h++;
            } val < 0 val 0 {
                h += 3;
            } h += 3 h 3 {
                t++;
                h++;
            } t++ t h++ h System.out.println(t + " " + h) System.out.println System.out System System.out t + " " + h t + " " + h t " " h String[] args args public class Main {
    private static final Scanner scn = new Scanner(System.in);
    
    public static void main(String[] args) {
        int t = 0, h = 0, lim = scn.nextInt();
        for(int i = 0; i < lim; i++) {
            int val = scn.next().compareTo(scn.next());
            if(val > 0) {
                t += 3;
            } else if(val < 0) {
                h += 3;
            } else {
                t++;
                h++;
            }
        }
        System.out.println(t + " " + h);
    }
} public class Main {
    private static final Scanner scn = new Scanner(System.in);
    
    public static void main(String[] args) {
        int t = 0, h = 0, lim = scn.nextInt();
        for(int i = 0; i < lim; i++) {
            int val = scn.next().compareTo(scn.next());
            if(val > 0) {
                t += 3;
            } else if(val < 0) {
                h += 3;
            } else {
                t++;
                h++;
            }
        }
        System.out.println(t + " " + h);
    }
} Main
import java.util.*;

public class Main {
    private static final Scanner scn = new Scanner(System.in);
    
    public static void main(String[] args) {
        int t = 0, h = 0, lim = scn.nextInt();
        for(int i = 0; i < lim; i++) {
            int val = scn.next().compareTo(scn.next());
            if(val > 0) {
                t += 3;
            } else if(val < 0) {
                h += 3;
            } else {
                t++;
                h++;
            }
        }
        System.out.println(t + " " + h);
    }
}