import java.util.Scanner;

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

    int n = reader.nextInt();
    int tScore = 0, hScore = 0;
    for (int i = 0; i < n; i++) {
      String tStr = reader.next();
      String hStr = reader.next();
      if (tStr.compareTo(hStr) > 0) {
        tScore += 3;
      }
      else if (tStr.compareTo(hStr) == 0) {
        tScore += 1;
        hScore += 1;
      }
      else {
        hScore += 3;
      }
    }
    System.out.println(tScore + " " + hScore);
  }
} import java.util.Scanner; Scanner java.util public class Main {
  public static void main(String[] args) {
    Scanner reader = new Scanner(System.in);

    int n = reader.nextInt();
    int tScore = 0, hScore = 0;
    for (int i = 0; i < n; i++) {
      String tStr = reader.next();
      String hStr = reader.next();
      if (tStr.compareTo(hStr) > 0) {
        tScore += 3;
      }
      else if (tStr.compareTo(hStr) == 0) {
        tScore += 1;
        hScore += 1;
      }
      else {
        hScore += 3;
      }
    }
    System.out.println(tScore + " " + hScore);
  }
} Main public static void main(String[] args) {
    Scanner reader = new Scanner(System.in);

    int n = reader.nextInt();
    int tScore = 0, hScore = 0;
    for (int i = 0; i < n; i++) {
      String tStr = reader.next();
      String hStr = reader.next();
      if (tStr.compareTo(hStr) > 0) {
        tScore += 3;
      }
      else if (tStr.compareTo(hStr) == 0) {
        tScore += 1;
        hScore += 1;
      }
      else {
        hScore += 3;
      }
    }
    System.out.println(tScore + " " + hScore);
  } main {
    Scanner reader = new Scanner(System.in);

    int n = reader.nextInt();
    int tScore = 0, hScore = 0;
    for (int i = 0; i < n; i++) {
      String tStr = reader.next();
      String hStr = reader.next();
      if (tStr.compareTo(hStr) > 0) {
        tScore += 3;
      }
      else if (tStr.compareTo(hStr) == 0) {
        tScore += 1;
        hScore += 1;
      }
      else {
        hScore += 3;
      }
    }
    System.out.println(tScore + " " + hScore);
  } Scanner reader = new Scanner(System.in); reader new Scanner(System.in) int n = reader.nextInt(); n reader.nextInt() reader.nextInt reader int tScore = 0 tScore 0 hScore = 0; hScore 0 for (int i = 0; i < n; i++) {
      String tStr = reader.next();
      String hStr = reader.next();
      if (tStr.compareTo(hStr) > 0) {
        tScore += 3;
      }
      else if (tStr.compareTo(hStr) == 0) {
        tScore += 1;
        hScore += 1;
      }
      else {
        hScore += 3;
      }
    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      String tStr = reader.next();
      String hStr = reader.next();
      if (tStr.compareTo(hStr) > 0) {
        tScore += 3;
      }
      else if (tStr.compareTo(hStr) == 0) {
        tScore += 1;
        hScore += 1;
      }
      else {
        hScore += 3;
      }
    } {
      String tStr = reader.next();
      String hStr = reader.next();
      if (tStr.compareTo(hStr) > 0) {
        tScore += 3;
      }
      else if (tStr.compareTo(hStr) == 0) {
        tScore += 1;
        hScore += 1;
      }
      else {
        hScore += 3;
      }
    } String tStr = reader.next(); tStr reader.next() reader.next reader String hStr = reader.next(); hStr reader.next() reader.next reader if (tStr.compareTo(hStr) > 0) {
        tScore += 3;
      }
      else if (tStr.compareTo(hStr) == 0) {
        tScore += 1;
        hScore += 1;
      }
      else {
        hScore += 3;
      } tStr.compareTo(hStr) > 0 tStr.compareTo(hStr) tStr.compareTo tStr hStr 0 {
        tScore += 3;
      } tScore += 3 tScore 3 if (tStr.compareTo(hStr) == 0) {
        tScore += 1;
        hScore += 1;
      }
      else {
        hScore += 3;
      } tStr.compareTo(hStr) == 0 tStr.compareTo(hStr) tStr.compareTo tStr hStr 0 {
        tScore += 1;
        hScore += 1;
      } tScore += 1 tScore 1 hScore += 1 hScore 1 {
        hScore += 3;
      } hScore += 3 hScore 3 System.out.println(tScore + " " + hScore) System.out.println System.out System System.out tScore + " " + hScore tScore + " " + hScore tScore " " hScore String[] args args public class Main {
  public static void main(String[] args) {
    Scanner reader = new Scanner(System.in);

    int n = reader.nextInt();
    int tScore = 0, hScore = 0;
    for (int i = 0; i < n; i++) {
      String tStr = reader.next();
      String hStr = reader.next();
      if (tStr.compareTo(hStr) > 0) {
        tScore += 3;
      }
      else if (tStr.compareTo(hStr) == 0) {
        tScore += 1;
        hScore += 1;
      }
      else {
        hScore += 3;
      }
    }
    System.out.println(tScore + " " + hScore);
  }
} public class Main {
  public static void main(String[] args) {
    Scanner reader = new Scanner(System.in);

    int n = reader.nextInt();
    int tScore = 0, hScore = 0;
    for (int i = 0; i < n; i++) {
      String tStr = reader.next();
      String hStr = reader.next();
      if (tStr.compareTo(hStr) > 0) {
        tScore += 3;
      }
      else if (tStr.compareTo(hStr) == 0) {
        tScore += 1;
        hScore += 1;
      }
      else {
        hScore += 3;
      }
    }
    System.out.println(tScore + " " + hScore);
  }
} Main
import java.util.Scanner;

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

    int n = reader.nextInt();
    int tScore = 0, hScore = 0;
    for (int i = 0; i < n; i++) {
      String tStr = reader.next();
      String hStr = reader.next();
      if (tStr.compareTo(hStr) > 0) {
        tScore += 3;
      }
      else if (tStr.compareTo(hStr) == 0) {
        tScore += 1;
        hScore += 1;
      }
      else {
        hScore += 3;
      }
    }
    System.out.println(tScore + " " + hScore);
  }
}