import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      int Taro = 0;
      int Hanako = 0;
      for (int i =0; i<n; i++) {
        String a = sc.next();
        String b = sc.next();
        if (a.equals(b)) {
          Taro += 1;
          Hanako += 1;
        } else if (a.compareTo(b)>0) {
          Taro += 3;
        } else {
          Hanako += 3;
        }
      }
        System.out.println(Taro + " " + Hanako);
    }
} 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 Taro = 0;
      int Hanako = 0;
      for (int i =0; i<n; i++) {
        String a = sc.next();
        String b = sc.next();
        if (a.equals(b)) {
          Taro += 1;
          Hanako += 1;
        } else if (a.compareTo(b)>0) {
          Taro += 3;
        } else {
          Hanako += 3;
        }
      }
        System.out.println(Taro + " " + Hanako);
    }
} Main public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      int Taro = 0;
      int Hanako = 0;
      for (int i =0; i<n; i++) {
        String a = sc.next();
        String b = sc.next();
        if (a.equals(b)) {
          Taro += 1;
          Hanako += 1;
        } else if (a.compareTo(b)>0) {
          Taro += 3;
        } else {
          Hanako += 3;
        }
      }
        System.out.println(Taro + " " + Hanako);
    } main {
      Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      int Taro = 0;
      int Hanako = 0;
      for (int i =0; i<n; i++) {
        String a = sc.next();
        String b = sc.next();
        if (a.equals(b)) {
          Taro += 1;
          Hanako += 1;
        } else if (a.compareTo(b)>0) {
          Taro += 3;
        } else {
          Hanako += 3;
        }
      }
        System.out.println(Taro + " " + Hanako);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int Taro = 0; Taro 0 int Hanako = 0; Hanako 0 for (int i =0; i<n; i++) {
        String a = sc.next();
        String b = sc.next();
        if (a.equals(b)) {
          Taro += 1;
          Hanako += 1;
        } else if (a.compareTo(b)>0) {
          Taro += 3;
        } else {
          Hanako += 3;
        }
      } int i =0; int i =0; i 0 i<n i n i++ i++ i {
        String a = sc.next();
        String b = sc.next();
        if (a.equals(b)) {
          Taro += 1;
          Hanako += 1;
        } else if (a.compareTo(b)>0) {
          Taro += 3;
        } else {
          Hanako += 3;
        }
      } {
        String a = sc.next();
        String b = sc.next();
        if (a.equals(b)) {
          Taro += 1;
          Hanako += 1;
        } else if (a.compareTo(b)>0) {
          Taro += 3;
        } else {
          Hanako += 3;
        }
      } String a = sc.next(); a sc.next() sc.next sc String b = sc.next(); b sc.next() sc.next sc if (a.equals(b)) {
          Taro += 1;
          Hanako += 1;
        } else if (a.compareTo(b)>0) {
          Taro += 3;
        } else {
          Hanako += 3;
        } a.equals(b) a.equals a b {
          Taro += 1;
          Hanako += 1;
        } Taro += 1 Taro 1 Hanako += 1 Hanako 1 if (a.compareTo(b)>0) {
          Taro += 3;
        } else {
          Hanako += 3;
        } a.compareTo(b)>0 a.compareTo(b) a.compareTo a b 0 {
          Taro += 3;
        } Taro += 3 Taro 3 {
          Hanako += 3;
        } Hanako += 3 Hanako 3 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);
      int n = sc.nextInt();
      int Taro = 0;
      int Hanako = 0;
      for (int i =0; i<n; i++) {
        String a = sc.next();
        String b = sc.next();
        if (a.equals(b)) {
          Taro += 1;
          Hanako += 1;
        } else if (a.compareTo(b)>0) {
          Taro += 3;
        } else {
          Hanako += 3;
        }
      }
        System.out.println(Taro + " " + Hanako);
    }
} public class Main {
	public static void main(String[] args) {
      Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      int Taro = 0;
      int Hanako = 0;
      for (int i =0; i<n; i++) {
        String a = sc.next();
        String b = sc.next();
        if (a.equals(b)) {
          Taro += 1;
          Hanako += 1;
        } else if (a.compareTo(b)>0) {
          Taro += 3;
        } else {
          Hanako += 3;
        }
      }
        System.out.println(Taro + " " + Hanako);
    }
} 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 Taro = 0;
      int Hanako = 0;
      for (int i =0; i<n; i++) {
        String a = sc.next();
        String b = sc.next();
        if (a.equals(b)) {
          Taro += 1;
          Hanako += 1;
        } else if (a.compareTo(b)>0) {
          Taro += 3;
        } else {
          Hanako += 3;
        }
      }
        System.out.println(Taro + " " + Hanako);
    }
}
