import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int tarou_point = 0;
        int hanako_point = 0;
        int n = sc.nextInt();
        while(true){
            for(int i = 0;i < n;i++) {
            	String tarou = sc.next();
                String hanako = sc.next();
            	if(tarou.compareTo(hanako) < 0){
                    hanako_point = hanako_point + 3;
                }else if(tarou.compareTo(hanako) > 0){
                    tarou_point = tarou_point + 3;
                }else if(tarou.compareTo(hanako) == 0){
                    tarou_point++;
                    hanako_point++;
                }
            }
            System.out.println(tarou_point + " " + hanako_point);
            break;
        }
    }
} import java.util.*; util.* java public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int tarou_point = 0;
        int hanako_point = 0;
        int n = sc.nextInt();
        while(true){
            for(int i = 0;i < n;i++) {
            	String tarou = sc.next();
                String hanako = sc.next();
            	if(tarou.compareTo(hanako) < 0){
                    hanako_point = hanako_point + 3;
                }else if(tarou.compareTo(hanako) > 0){
                    tarou_point = tarou_point + 3;
                }else if(tarou.compareTo(hanako) == 0){
                    tarou_point++;
                    hanako_point++;
                }
            }
            System.out.println(tarou_point + " " + hanako_point);
            break;
        }
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int tarou_point = 0;
        int hanako_point = 0;
        int n = sc.nextInt();
        while(true){
            for(int i = 0;i < n;i++) {
            	String tarou = sc.next();
                String hanako = sc.next();
            	if(tarou.compareTo(hanako) < 0){
                    hanako_point = hanako_point + 3;
                }else if(tarou.compareTo(hanako) > 0){
                    tarou_point = tarou_point + 3;
                }else if(tarou.compareTo(hanako) == 0){
                    tarou_point++;
                    hanako_point++;
                }
            }
            System.out.println(tarou_point + " " + hanako_point);
            break;
        }
    } main {
        Scanner sc = new Scanner(System.in);
        int tarou_point = 0;
        int hanako_point = 0;
        int n = sc.nextInt();
        while(true){
            for(int i = 0;i < n;i++) {
            	String tarou = sc.next();
                String hanako = sc.next();
            	if(tarou.compareTo(hanako) < 0){
                    hanako_point = hanako_point + 3;
                }else if(tarou.compareTo(hanako) > 0){
                    tarou_point = tarou_point + 3;
                }else if(tarou.compareTo(hanako) == 0){
                    tarou_point++;
                    hanako_point++;
                }
            }
            System.out.println(tarou_point + " " + hanako_point);
            break;
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int tarou_point = 0; tarou_point 0 int hanako_point = 0; hanako_point 0 int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc while(true){
            for(int i = 0;i < n;i++) {
            	String tarou = sc.next();
                String hanako = sc.next();
            	if(tarou.compareTo(hanako) < 0){
                    hanako_point = hanako_point + 3;
                }else if(tarou.compareTo(hanako) > 0){
                    tarou_point = tarou_point + 3;
                }else if(tarou.compareTo(hanako) == 0){
                    tarou_point++;
                    hanako_point++;
                }
            }
            System.out.println(tarou_point + " " + hanako_point);
            break;
        } true {
            for(int i = 0;i < n;i++) {
            	String tarou = sc.next();
                String hanako = sc.next();
            	if(tarou.compareTo(hanako) < 0){
                    hanako_point = hanako_point + 3;
                }else if(tarou.compareTo(hanako) > 0){
                    tarou_point = tarou_point + 3;
                }else if(tarou.compareTo(hanako) == 0){
                    tarou_point++;
                    hanako_point++;
                }
            }
            System.out.println(tarou_point + " " + hanako_point);
            break;
        } for(int i = 0;i < n;i++) {
            	String tarou = sc.next();
                String hanako = sc.next();
            	if(tarou.compareTo(hanako) < 0){
                    hanako_point = hanako_point + 3;
                }else if(tarou.compareTo(hanako) > 0){
                    tarou_point = tarou_point + 3;
                }else if(tarou.compareTo(hanako) == 0){
                    tarou_point++;
                    hanako_point++;
                }
            } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            	String tarou = sc.next();
                String hanako = sc.next();
            	if(tarou.compareTo(hanako) < 0){
                    hanako_point = hanako_point + 3;
                }else if(tarou.compareTo(hanako) > 0){
                    tarou_point = tarou_point + 3;
                }else if(tarou.compareTo(hanako) == 0){
                    tarou_point++;
                    hanako_point++;
                }
            } {
            	String tarou = sc.next();
                String hanako = sc.next();
            	if(tarou.compareTo(hanako) < 0){
                    hanako_point = hanako_point + 3;
                }else if(tarou.compareTo(hanako) > 0){
                    tarou_point = tarou_point + 3;
                }else if(tarou.compareTo(hanako) == 0){
                    tarou_point++;
                    hanako_point++;
                }
            } String tarou = sc.next(); tarou sc.next() sc.next sc String hanako = sc.next(); hanako sc.next() sc.next sc if(tarou.compareTo(hanako) < 0){
                    hanako_point = hanako_point + 3;
                }else if(tarou.compareTo(hanako) > 0){
                    tarou_point = tarou_point + 3;
                }else if(tarou.compareTo(hanako) == 0){
                    tarou_point++;
                    hanako_point++;
                } tarou.compareTo(hanako) < 0 tarou.compareTo(hanako) tarou.compareTo tarou hanako 0 {
                    hanako_point = hanako_point + 3;
                } hanako_point = hanako_point + 3 hanako_point hanako_point + 3 hanako_point 3 if(tarou.compareTo(hanako) > 0){
                    tarou_point = tarou_point + 3;
                }else if(tarou.compareTo(hanako) == 0){
                    tarou_point++;
                    hanako_point++;
                } tarou.compareTo(hanako) > 0 tarou.compareTo(hanako) tarou.compareTo tarou hanako 0 {
                    tarou_point = tarou_point + 3;
                } tarou_point = tarou_point + 3 tarou_point tarou_point + 3 tarou_point 3 if(tarou.compareTo(hanako) == 0){
                    tarou_point++;
                    hanako_point++;
                } tarou.compareTo(hanako) == 0 tarou.compareTo(hanako) tarou.compareTo tarou hanako 0 {
                    tarou_point++;
                    hanako_point++;
                } tarou_point++ tarou_point hanako_point++ hanako_point System.out.println(tarou_point + " " + hanako_point) System.out.println System.out System System.out tarou_point + " " + hanako_point tarou_point + " " + hanako_point tarou_point " " hanako_point break; String[] args args public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int tarou_point = 0;
        int hanako_point = 0;
        int n = sc.nextInt();
        while(true){
            for(int i = 0;i < n;i++) {
            	String tarou = sc.next();
                String hanako = sc.next();
            	if(tarou.compareTo(hanako) < 0){
                    hanako_point = hanako_point + 3;
                }else if(tarou.compareTo(hanako) > 0){
                    tarou_point = tarou_point + 3;
                }else if(tarou.compareTo(hanako) == 0){
                    tarou_point++;
                    hanako_point++;
                }
            }
            System.out.println(tarou_point + " " + hanako_point);
            break;
        }
    }
} public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int tarou_point = 0;
        int hanako_point = 0;
        int n = sc.nextInt();
        while(true){
            for(int i = 0;i < n;i++) {
            	String tarou = sc.next();
                String hanako = sc.next();
            	if(tarou.compareTo(hanako) < 0){
                    hanako_point = hanako_point + 3;
                }else if(tarou.compareTo(hanako) > 0){
                    tarou_point = tarou_point + 3;
                }else if(tarou.compareTo(hanako) == 0){
                    tarou_point++;
                    hanako_point++;
                }
            }
            System.out.println(tarou_point + " " + hanako_point);
            break;
        }
    }
} Main
import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int tarou_point = 0;
        int hanako_point = 0;
        int n = sc.nextInt();
        while(true){
            for(int i = 0;i < n;i++) {
            	String tarou = sc.next();
                String hanako = sc.next();
            	if(tarou.compareTo(hanako) < 0){
                    hanako_point = hanako_point + 3;
                }else if(tarou.compareTo(hanako) > 0){
                    tarou_point = tarou_point + 3;
                }else if(tarou.compareTo(hanako) == 0){
                    tarou_point++;
                    hanako_point++;
                }
            }
            System.out.println(tarou_point + " " + hanako_point);
            break;
        }
    }
}
