import java.util.Scanner;

public class Main {

  public static void main(String[] args) {

    Scanner scan = new Scanner(System.in);

    int n = scan.nextInt();

    int taro = 0;
    int hanako = 0;

    for (int i = 0; i < n; i++) {
      
      String taros = scan.next();
      String hanakos = scan.next();

      int result = taros.compareTo(hanakos);
      if (result > 0) {
        taro += 3;
      } else if (result < 0) {
        hanako += 3;
      } else {
        taro++;
        hanako++;
      }

    }
    
    System.out.println(taro + " " + hanako);

  }

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

  public static void main(String[] args) {

    Scanner scan = new Scanner(System.in);

    int n = scan.nextInt();

    int taro = 0;
    int hanako = 0;

    for (int i = 0; i < n; i++) {
      
      String taros = scan.next();
      String hanakos = scan.next();

      int result = taros.compareTo(hanakos);
      if (result > 0) {
        taro += 3;
      } else if (result < 0) {
        hanako += 3;
      } else {
        taro++;
        hanako++;
      }

    }
    
    System.out.println(taro + " " + hanako);

  }

} Main public static void main(String[] args) {

    Scanner scan = new Scanner(System.in);

    int n = scan.nextInt();

    int taro = 0;
    int hanako = 0;

    for (int i = 0; i < n; i++) {
      
      String taros = scan.next();
      String hanakos = scan.next();

      int result = taros.compareTo(hanakos);
      if (result > 0) {
        taro += 3;
      } else if (result < 0) {
        hanako += 3;
      } else {
        taro++;
        hanako++;
      }

    }
    
    System.out.println(taro + " " + hanako);

  } main {

    Scanner scan = new Scanner(System.in);

    int n = scan.nextInt();

    int taro = 0;
    int hanako = 0;

    for (int i = 0; i < n; i++) {
      
      String taros = scan.next();
      String hanakos = scan.next();

      int result = taros.compareTo(hanakos);
      if (result > 0) {
        taro += 3;
      } else if (result < 0) {
        hanako += 3;
      } else {
        taro++;
        hanako++;
      }

    }
    
    System.out.println(taro + " " + hanako);

  } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int taro = 0; taro 0 int hanako = 0; hanako 0 for (int i = 0; i < n; i++) {
      
      String taros = scan.next();
      String hanakos = scan.next();

      int result = taros.compareTo(hanakos);
      if (result > 0) {
        taro += 3;
      } else if (result < 0) {
        hanako += 3;
      } else {
        taro++;
        hanako++;
      }

    } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {
      
      String taros = scan.next();
      String hanakos = scan.next();

      int result = taros.compareTo(hanakos);
      if (result > 0) {
        taro += 3;
      } else if (result < 0) {
        hanako += 3;
      } else {
        taro++;
        hanako++;
      }

    } {
      
      String taros = scan.next();
      String hanakos = scan.next();

      int result = taros.compareTo(hanakos);
      if (result > 0) {
        taro += 3;
      } else if (result < 0) {
        hanako += 3;
      } else {
        taro++;
        hanako++;
      }

    } String taros = scan.next(); taros scan.next() scan.next scan String hanakos = scan.next(); hanakos scan.next() scan.next scan int result = taros.compareTo(hanakos); result taros.compareTo(hanakos) taros.compareTo taros hanakos if (result > 0) {
        taro += 3;
      } else if (result < 0) {
        hanako += 3;
      } else {
        taro++;
        hanako++;
      } result > 0 result 0 {
        taro += 3;
      } taro += 3 taro 3 if (result < 0) {
        hanako += 3;
      } else {
        taro++;
        hanako++;
      } result < 0 result 0 {
        hanako += 3;
      } hanako += 3 hanako 3 {
        taro++;
        hanako++;
      } taro++ taro hanako++ hanako 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 scan = new Scanner(System.in);

    int n = scan.nextInt();

    int taro = 0;
    int hanako = 0;

    for (int i = 0; i < n; i++) {
      
      String taros = scan.next();
      String hanakos = scan.next();

      int result = taros.compareTo(hanakos);
      if (result > 0) {
        taro += 3;
      } else if (result < 0) {
        hanako += 3;
      } else {
        taro++;
        hanako++;
      }

    }
    
    System.out.println(taro + " " + hanako);

  }

} public class Main {

  public static void main(String[] args) {

    Scanner scan = new Scanner(System.in);

    int n = scan.nextInt();

    int taro = 0;
    int hanako = 0;

    for (int i = 0; i < n; i++) {
      
      String taros = scan.next();
      String hanakos = scan.next();

      int result = taros.compareTo(hanakos);
      if (result > 0) {
        taro += 3;
      } else if (result < 0) {
        hanako += 3;
      } else {
        taro++;
        hanako++;
      }

    }
    
    System.out.println(taro + " " + hanako);

  }

} Main
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {

    Scanner scan = new Scanner(System.in);

    int n = scan.nextInt();

    int taro = 0;
    int hanako = 0;

    for (int i = 0; i < n; i++) {
      
      String taros = scan.next();
      String hanakos = scan.next();

      int result = taros.compareTo(hanakos);
      if (result > 0) {
        taro += 3;
      } else if (result < 0) {
        hanako += 3;
      } else {
        taro++;
        hanako++;
      }

    }
    
    System.out.println(taro + " " + hanako);

  }

}

