import java.util.Scanner;

class Main {  
  public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    int num = in.nextInt();
    
    int Taro = 0;
    int Hanako = 0;
    
    while (num != 0) {
      String taro = in.next();
      String hanako = in.next();
      if      (taro.compareTo(hanako) < 0) {Hanako += 3; }
      else if (taro.compareTo(hanako) > 0) {Taro += 3; }
      else                                 {Taro += 1; Hanako += 1;}
      num--;
    }
    System.out.println(Taro + " " + Hanako);
  }
} import java.util.Scanner; Scanner java.util class Main {  
  public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    int num = in.nextInt();
    
    int Taro = 0;
    int Hanako = 0;
    
    while (num != 0) {
      String taro = in.next();
      String hanako = in.next();
      if      (taro.compareTo(hanako) < 0) {Hanako += 3; }
      else if (taro.compareTo(hanako) > 0) {Taro += 3; }
      else                                 {Taro += 1; Hanako += 1;}
      num--;
    }
    System.out.println(Taro + " " + Hanako);
  }
} Main public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    int num = in.nextInt();
    
    int Taro = 0;
    int Hanako = 0;
    
    while (num != 0) {
      String taro = in.next();
      String hanako = in.next();
      if      (taro.compareTo(hanako) < 0) {Hanako += 3; }
      else if (taro.compareTo(hanako) > 0) {Taro += 3; }
      else                                 {Taro += 1; Hanako += 1;}
      num--;
    }
    System.out.println(Taro + " " + Hanako);
  } main {
    Scanner in = new Scanner(System.in);
    int num = in.nextInt();
    
    int Taro = 0;
    int Hanako = 0;
    
    while (num != 0) {
      String taro = in.next();
      String hanako = in.next();
      if      (taro.compareTo(hanako) < 0) {Hanako += 3; }
      else if (taro.compareTo(hanako) > 0) {Taro += 3; }
      else                                 {Taro += 1; Hanako += 1;}
      num--;
    }
    System.out.println(Taro + " " + Hanako);
  } Scanner in = new Scanner(System.in); in new Scanner(System.in) int num = in.nextInt(); num in.nextInt() in.nextInt in int Taro = 0; Taro 0 int Hanako = 0; Hanako 0 while (num != 0) {
      String taro = in.next();
      String hanako = in.next();
      if      (taro.compareTo(hanako) < 0) {Hanako += 3; }
      else if (taro.compareTo(hanako) > 0) {Taro += 3; }
      else                                 {Taro += 1; Hanako += 1;}
      num--;
    } num != 0 num 0 {
      String taro = in.next();
      String hanako = in.next();
      if      (taro.compareTo(hanako) < 0) {Hanako += 3; }
      else if (taro.compareTo(hanako) > 0) {Taro += 3; }
      else                                 {Taro += 1; Hanako += 1;}
      num--;
    } String taro = in.next(); taro in.next() in.next in String hanako = in.next(); hanako in.next() in.next in if      (taro.compareTo(hanako) < 0) {Hanako += 3; }
      else if (taro.compareTo(hanako) > 0) {Taro += 3; }
      else                                 {Taro += 1; Hanako += 1;} taro.compareTo(hanako) < 0 taro.compareTo(hanako) taro.compareTo taro hanako 0 {Hanako += 3; } Hanako += 3 Hanako 3 if (taro.compareTo(hanako) > 0) {Taro += 3; }
      else                                 {Taro += 1; Hanako += 1;} taro.compareTo(hanako) > 0 taro.compareTo(hanako) taro.compareTo taro hanako 0 {Taro += 3; } Taro += 3 Taro 3 {Taro += 1; Hanako += 1;} Taro += 1 Taro 1 Hanako += 1 Hanako 1 num-- num System.out.println(Taro + " " + Hanako) System.out.println System.out System System.out Taro + " " + Hanako Taro + " " + Hanako Taro " " Hanako String[] args args
import java.util.Scanner;

class Main {  
  public static void main(String[] args) {
    Scanner in = new Scanner(System.in);
    int num = in.nextInt();
    
    int Taro = 0;
    int Hanako = 0;
    
    while (num != 0) {
      String taro = in.next();
      String hanako = in.next();
      if      (taro.compareTo(hanako) < 0) {Hanako += 3; }
      else if (taro.compareTo(hanako) > 0) {Taro += 3; }
      else                                 {Taro += 1; Hanako += 1;}
      num--;
    }
    System.out.println(Taro + " " + Hanako);
  }
}