import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        int n = Integer.parseInt(line);
        int taro = 0;
        int hanako = 0;
        for(int i = 0; i < n; i++) {
            String line1 = sc.nextLine();
            String[] ani = line1.split(" ");
            if(ani[0].compareTo(ani[1]) < 0) {
                hanako += 3;
            } else if(ani[1].compareTo(ani[0]) < 0) {
                taro += 3;
            }else if(ani[1].compareTo(ani[0]) == 0) {
                taro += 1;
                hanako += 1;
            }
        }
        System.out.println(taro + " " + hanako);

    }
 } import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        int n = Integer.parseInt(line);
        int taro = 0;
        int hanako = 0;
        for(int i = 0; i < n; i++) {
            String line1 = sc.nextLine();
            String[] ani = line1.split(" ");
            if(ani[0].compareTo(ani[1]) < 0) {
                hanako += 3;
            } else if(ani[1].compareTo(ani[0]) < 0) {
                taro += 3;
            }else if(ani[1].compareTo(ani[0]) == 0) {
                taro += 1;
                hanako += 1;
            }
        }
        System.out.println(taro + " " + hanako);

    }
 } Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        int n = Integer.parseInt(line);
        int taro = 0;
        int hanako = 0;
        for(int i = 0; i < n; i++) {
            String line1 = sc.nextLine();
            String[] ani = line1.split(" ");
            if(ani[0].compareTo(ani[1]) < 0) {
                hanako += 3;
            } else if(ani[1].compareTo(ani[0]) < 0) {
                taro += 3;
            }else if(ani[1].compareTo(ani[0]) == 0) {
                taro += 1;
                hanako += 1;
            }
        }
        System.out.println(taro + " " + hanako);

    } main {
        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        int n = Integer.parseInt(line);
        int taro = 0;
        int hanako = 0;
        for(int i = 0; i < n; i++) {
            String line1 = sc.nextLine();
            String[] ani = line1.split(" ");
            if(ani[0].compareTo(ani[1]) < 0) {
                hanako += 3;
            } else if(ani[1].compareTo(ani[0]) < 0) {
                taro += 3;
            }else if(ani[1].compareTo(ani[0]) == 0) {
                taro += 1;
                hanako += 1;
            }
        }
        System.out.println(taro + " " + hanako);

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String line = sc.nextLine(); line sc.nextLine() sc.nextLine sc int n = Integer.parseInt(line); n Integer.parseInt(line) Integer.parseInt Integer line int taro = 0; taro 0 int hanako = 0; hanako 0 for(int i = 0; i < n; i++) {
            String line1 = sc.nextLine();
            String[] ani = line1.split(" ");
            if(ani[0].compareTo(ani[1]) < 0) {
                hanako += 3;
            } else if(ani[1].compareTo(ani[0]) < 0) {
                taro += 3;
            }else if(ani[1].compareTo(ani[0]) == 0) {
                taro += 1;
                hanako += 1;
            }
        } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
            String line1 = sc.nextLine();
            String[] ani = line1.split(" ");
            if(ani[0].compareTo(ani[1]) < 0) {
                hanako += 3;
            } else if(ani[1].compareTo(ani[0]) < 0) {
                taro += 3;
            }else if(ani[1].compareTo(ani[0]) == 0) {
                taro += 1;
                hanako += 1;
            }
        } {
            String line1 = sc.nextLine();
            String[] ani = line1.split(" ");
            if(ani[0].compareTo(ani[1]) < 0) {
                hanako += 3;
            } else if(ani[1].compareTo(ani[0]) < 0) {
                taro += 3;
            }else if(ani[1].compareTo(ani[0]) == 0) {
                taro += 1;
                hanako += 1;
            }
        } String line1 = sc.nextLine(); line1 sc.nextLine() sc.nextLine sc String[] ani = line1.split(" "); ani line1.split(" ") line1.split line1 " " if(ani[0].compareTo(ani[1]) < 0) {
                hanako += 3;
            } else if(ani[1].compareTo(ani[0]) < 0) {
                taro += 3;
            }else if(ani[1].compareTo(ani[0]) == 0) {
                taro += 1;
                hanako += 1;
            } ani[0].compareTo(ani[1]) < 0 ani[0].compareTo(ani[1]) ani[0].compareTo ani[0] ani 0 ani[1] ani 1 0 {
                hanako += 3;
            } hanako += 3 hanako 3 if(ani[1].compareTo(ani[0]) < 0) {
                taro += 3;
            }else if(ani[1].compareTo(ani[0]) == 0) {
                taro += 1;
                hanako += 1;
            } ani[1].compareTo(ani[0]) < 0 ani[1].compareTo(ani[0]) ani[1].compareTo ani[1] ani 1 ani[0] ani 0 0 {
                taro += 3;
            } taro += 3 taro 3 if(ani[1].compareTo(ani[0]) == 0) {
                taro += 1;
                hanako += 1;
            } ani[1].compareTo(ani[0]) == 0 ani[1].compareTo(ani[0]) ani[1].compareTo ani[1] ani 1 ani[0] ani 0 0 {
                taro += 1;
                hanako += 1;
            } taro += 1 taro 1 hanako += 1 hanako 1 System.out.println(taro + " " + hanako) System.out.println System.out System System.out taro + " " + hanako taro + " " + hanako taro " " hanako String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        int n = Integer.parseInt(line);
        int taro = 0;
        int hanako = 0;
        for(int i = 0; i < n; i++) {
            String line1 = sc.nextLine();
            String[] ani = line1.split(" ");
            if(ani[0].compareTo(ani[1]) < 0) {
                hanako += 3;
            } else if(ani[1].compareTo(ani[0]) < 0) {
                taro += 3;
            }else if(ani[1].compareTo(ani[0]) == 0) {
                taro += 1;
                hanako += 1;
            }
        }
        System.out.println(taro + " " + hanako);

    }
 } public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        int n = Integer.parseInt(line);
        int taro = 0;
        int hanako = 0;
        for(int i = 0; i < n; i++) {
            String line1 = sc.nextLine();
            String[] ani = line1.split(" ");
            if(ani[0].compareTo(ani[1]) < 0) {
                hanako += 3;
            } else if(ani[1].compareTo(ani[0]) < 0) {
                taro += 3;
            }else if(ani[1].compareTo(ani[0]) == 0) {
                taro += 1;
                hanako += 1;
            }
        }
        System.out.println(taro + " " + hanako);

    }
 } Main
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        int n = Integer.parseInt(line);
        int taro = 0;
        int hanako = 0;
        for(int i = 0; i < n; i++) {
            String line1 = sc.nextLine();
            String[] ani = line1.split(" ");
            if(ani[0].compareTo(ani[1]) < 0) {
                hanako += 3;
            } else if(ani[1].compareTo(ani[0]) < 0) {
                taro += 3;
            }else if(ani[1].compareTo(ani[0]) == 0) {
                taro += 1;
                hanako += 1;
            }
        }
        System.out.println(taro + " " + hanako);

    }
 }
