import java.util.Scanner;

public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);

    int n = sc.nextInt();

    int ap = 0;
    int bp = 0;
    for (int i = 0; i < n; i++) {
        int result = sc.next().compareTo(sc.next());
        ap += result > 0 ? 3 : result < 0 ? 0 : 1;
        bp += result > 0 ? 0 : result < 0 ? 3 : 1;
    }

    System.out.println(ap + " " + bp);
  }
} import java.util.Scanner; Scanner java.util public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);

    int n = sc.nextInt();

    int ap = 0;
    int bp = 0;
    for (int i = 0; i < n; i++) {
        int result = sc.next().compareTo(sc.next());
        ap += result > 0 ? 3 : result < 0 ? 0 : 1;
        bp += result > 0 ? 0 : result < 0 ? 3 : 1;
    }

    System.out.println(ap + " " + bp);
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);

    int n = sc.nextInt();

    int ap = 0;
    int bp = 0;
    for (int i = 0; i < n; i++) {
        int result = sc.next().compareTo(sc.next());
        ap += result > 0 ? 3 : result < 0 ? 0 : 1;
        bp += result > 0 ? 0 : result < 0 ? 3 : 1;
    }

    System.out.println(ap + " " + bp);
  } main {
    Scanner sc = new Scanner(System.in);

    int n = sc.nextInt();

    int ap = 0;
    int bp = 0;
    for (int i = 0; i < n; i++) {
        int result = sc.next().compareTo(sc.next());
        ap += result > 0 ? 3 : result < 0 ? 0 : 1;
        bp += result > 0 ? 0 : result < 0 ? 3 : 1;
    }

    System.out.println(ap + " " + bp);
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int ap = 0; ap 0 int bp = 0; bp 0 for (int i = 0; i < n; i++) {
        int result = sc.next().compareTo(sc.next());
        ap += result > 0 ? 3 : result < 0 ? 0 : 1;
        bp += result > 0 ? 0 : result < 0 ? 3 : 1;
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
        int result = sc.next().compareTo(sc.next());
        ap += result > 0 ? 3 : result < 0 ? 0 : 1;
        bp += result > 0 ? 0 : result < 0 ? 3 : 1;
    } {
        int result = sc.next().compareTo(sc.next());
        ap += result > 0 ? 3 : result < 0 ? 0 : 1;
        bp += result > 0 ? 0 : result < 0 ? 3 : 1;
    } int result = sc.next().compareTo(sc.next()); result sc.next().compareTo(sc.next()) sc.next().compareTo sc.next() sc.next sc sc.next() sc.next sc ap += result > 0 ? 3 : result < 0 ? 0 : 1 ap result > 0 ? 3 : result < 0 ? 0 : 1 result > 0 result 0 3 result < 0 ? 0 : 1 result < 0 result 0 0 1 bp += result > 0 ? 0 : result < 0 ? 3 : 1 bp result > 0 ? 0 : result < 0 ? 3 : 1 result > 0 result 0 0 result < 0 ? 3 : 1 result < 0 result 0 3 1 System.out.println(ap + " " + bp) System.out.println System.out System System.out ap + " " + bp ap + " " + bp ap " " bp String[] args args public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);

    int n = sc.nextInt();

    int ap = 0;
    int bp = 0;
    for (int i = 0; i < n; i++) {
        int result = sc.next().compareTo(sc.next());
        ap += result > 0 ? 3 : result < 0 ? 0 : 1;
        bp += result > 0 ? 0 : result < 0 ? 3 : 1;
    }

    System.out.println(ap + " " + bp);
  }
} public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);

    int n = sc.nextInt();

    int ap = 0;
    int bp = 0;
    for (int i = 0; i < n; i++) {
        int result = sc.next().compareTo(sc.next());
        ap += result > 0 ? 3 : result < 0 ? 0 : 1;
        bp += result > 0 ? 0 : result < 0 ? 3 : 1;
    }

    System.out.println(ap + " " + bp);
  }
} Main
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);

    int n = sc.nextInt();

    int ap = 0;
    int bp = 0;
    for (int i = 0; i < n; i++) {
        int result = sc.next().compareTo(sc.next());
        ap += result > 0 ? 3 : result < 0 ? 0 : 1;
        bp += result > 0 ? 0 : result < 0 ? 3 : 1;
    }

    System.out.println(ap + " " + bp);
  }
}
