import java.util.Scanner;

public class Main {

  public static void main(String[] args) {
    Scanner stdin = new Scanner(System.in);
    int n = stdin.nextInt();
    int taro = 0;
    int hanako = 0;
    for (int i = 0; i < n; i++) {
      String a = stdin.next();
      String b = stdin.next();
      if (a.compareTo(b) > 0) {
        taro += 3;
      } else if (a.compareTo(b) < 0) {
        hanako += 3;
      } else {
        taro++;
        hanako++;
      }
    }

    System.out.printf("%d %d%n", taro, hanako);
  }

} import java.util.Scanner; Scanner java.util public class Main {

  public static void main(String[] args) {
    Scanner stdin = new Scanner(System.in);
    int n = stdin.nextInt();
    int taro = 0;
    int hanako = 0;
    for (int i = 0; i < n; i++) {
      String a = stdin.next();
      String b = stdin.next();
      if (a.compareTo(b) > 0) {
        taro += 3;
      } else if (a.compareTo(b) < 0) {
        hanako += 3;
      } else {
        taro++;
        hanako++;
      }
    }

    System.out.printf("%d %d%n", taro, hanako);
  }

} Main public static void main(String[] args) {
    Scanner stdin = new Scanner(System.in);
    int n = stdin.nextInt();
    int taro = 0;
    int hanako = 0;
    for (int i = 0; i < n; i++) {
      String a = stdin.next();
      String b = stdin.next();
      if (a.compareTo(b) > 0) {
        taro += 3;
      } else if (a.compareTo(b) < 0) {
        hanako += 3;
      } else {
        taro++;
        hanako++;
      }
    }

    System.out.printf("%d %d%n", taro, hanako);
  } main {
    Scanner stdin = new Scanner(System.in);
    int n = stdin.nextInt();
    int taro = 0;
    int hanako = 0;
    for (int i = 0; i < n; i++) {
      String a = stdin.next();
      String b = stdin.next();
      if (a.compareTo(b) > 0) {
        taro += 3;
      } else if (a.compareTo(b) < 0) {
        hanako += 3;
      } else {
        taro++;
        hanako++;
      }
    }

    System.out.printf("%d %d%n", taro, hanako);
  } Scanner stdin = new Scanner(System.in); stdin new Scanner(System.in) int n = stdin.nextInt(); n stdin.nextInt() stdin.nextInt stdin int taro = 0; taro 0 int hanako = 0; hanako 0 for (int i = 0; i < n; i++) {
      String a = stdin.next();
      String b = stdin.next();
      if (a.compareTo(b) > 0) {
        taro += 3;
      } else if (a.compareTo(b) < 0) {
        hanako += 3;
      } else {
        taro++;
        hanako++;
      }
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      String a = stdin.next();
      String b = stdin.next();
      if (a.compareTo(b) > 0) {
        taro += 3;
      } else if (a.compareTo(b) < 0) {
        hanako += 3;
      } else {
        taro++;
        hanako++;
      }
    } {
      String a = stdin.next();
      String b = stdin.next();
      if (a.compareTo(b) > 0) {
        taro += 3;
      } else if (a.compareTo(b) < 0) {
        hanako += 3;
      } else {
        taro++;
        hanako++;
      }
    } String a = stdin.next(); a stdin.next() stdin.next stdin String b = stdin.next(); b stdin.next() stdin.next stdin if (a.compareTo(b) > 0) {
        taro += 3;
      } else if (a.compareTo(b) < 0) {
        hanako += 3;
      } else {
        taro++;
        hanako++;
      } a.compareTo(b) > 0 a.compareTo(b) a.compareTo a b 0 {
        taro += 3;
      } taro += 3 taro 3 if (a.compareTo(b) < 0) {
        hanako += 3;
      } else {
        taro++;
        hanako++;
      } a.compareTo(b) < 0 a.compareTo(b) a.compareTo a b 0 {
        hanako += 3;
      } hanako += 3 hanako 3 {
        taro++;
        hanako++;
      } taro++ taro hanako++ hanako System.out.printf("%d %d%n", taro, hanako) System.out.printf System.out System System.out "%d %d%n" taro hanako String[] args args public class Main {

  public static void main(String[] args) {
    Scanner stdin = new Scanner(System.in);
    int n = stdin.nextInt();
    int taro = 0;
    int hanako = 0;
    for (int i = 0; i < n; i++) {
      String a = stdin.next();
      String b = stdin.next();
      if (a.compareTo(b) > 0) {
        taro += 3;
      } else if (a.compareTo(b) < 0) {
        hanako += 3;
      } else {
        taro++;
        hanako++;
      }
    }

    System.out.printf("%d %d%n", taro, hanako);
  }

} public class Main {

  public static void main(String[] args) {
    Scanner stdin = new Scanner(System.in);
    int n = stdin.nextInt();
    int taro = 0;
    int hanako = 0;
    for (int i = 0; i < n; i++) {
      String a = stdin.next();
      String b = stdin.next();
      if (a.compareTo(b) > 0) {
        taro += 3;
      } else if (a.compareTo(b) < 0) {
        hanako += 3;
      } else {
        taro++;
        hanako++;
      }
    }

    System.out.printf("%d %d%n", taro, hanako);
  }

} Main
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {
    Scanner stdin = new Scanner(System.in);
    int n = stdin.nextInt();
    int taro = 0;
    int hanako = 0;
    for (int i = 0; i < n; i++) {
      String a = stdin.next();
      String b = stdin.next();
      if (a.compareTo(b) > 0) {
        taro += 3;
      } else if (a.compareTo(b) < 0) {
        hanako += 3;
      } else {
        taro++;
        hanako++;
      }
    }

    System.out.printf("%d %d%n", taro, hanako);
  }

}