import java.io.*;
import java.util.*;
import java.lang.*;

class Main{
  public static void main(String[] args) throws IOException{
    Scanner scan=new Scanner(System.in);
    int n=Integer.parseInt(scan.next());
    int hanakoPoint=0;
    int tarouPoint=0;
    for(int i=0;i<n;i++){
      String hanakoCard=scan.next();
      String tarouCard=scan.next();
      int judge=hanakoCard.compareTo(tarouCard);
      if(judge<0){
        hanakoPoint+=3;
      }else if(judge>0){
        tarouPoint+=3;
      }else{
        hanakoPoint++;
        tarouPoint++;
      }
    }

    System.out.println(tarouPoint+" "+hanakoPoint);
  }
} import java.io.*; io.* java import java.util.*; util.* java import java.lang.*; lang.* java class Main{
  public static void main(String[] args) throws IOException{
    Scanner scan=new Scanner(System.in);
    int n=Integer.parseInt(scan.next());
    int hanakoPoint=0;
    int tarouPoint=0;
    for(int i=0;i<n;i++){
      String hanakoCard=scan.next();
      String tarouCard=scan.next();
      int judge=hanakoCard.compareTo(tarouCard);
      if(judge<0){
        hanakoPoint+=3;
      }else if(judge>0){
        tarouPoint+=3;
      }else{
        hanakoPoint++;
        tarouPoint++;
      }
    }

    System.out.println(tarouPoint+" "+hanakoPoint);
  }
} Main public static void main(String[] args) throws IOException{
    Scanner scan=new Scanner(System.in);
    int n=Integer.parseInt(scan.next());
    int hanakoPoint=0;
    int tarouPoint=0;
    for(int i=0;i<n;i++){
      String hanakoCard=scan.next();
      String tarouCard=scan.next();
      int judge=hanakoCard.compareTo(tarouCard);
      if(judge<0){
        hanakoPoint+=3;
      }else if(judge>0){
        tarouPoint+=3;
      }else{
        hanakoPoint++;
        tarouPoint++;
      }
    }

    System.out.println(tarouPoint+" "+hanakoPoint);
  } main {
    Scanner scan=new Scanner(System.in);
    int n=Integer.parseInt(scan.next());
    int hanakoPoint=0;
    int tarouPoint=0;
    for(int i=0;i<n;i++){
      String hanakoCard=scan.next();
      String tarouCard=scan.next();
      int judge=hanakoCard.compareTo(tarouCard);
      if(judge<0){
        hanakoPoint+=3;
      }else if(judge>0){
        tarouPoint+=3;
      }else{
        hanakoPoint++;
        tarouPoint++;
      }
    }

    System.out.println(tarouPoint+" "+hanakoPoint);
  } Scanner scan=new Scanner(System.in); scan new Scanner(System.in) int n=Integer.parseInt(scan.next()); n Integer.parseInt(scan.next()) Integer.parseInt Integer scan.next() scan.next scan int hanakoPoint=0; hanakoPoint 0 int tarouPoint=0; tarouPoint 0 for(int i=0;i<n;i++){
      String hanakoCard=scan.next();
      String tarouCard=scan.next();
      int judge=hanakoCard.compareTo(tarouCard);
      if(judge<0){
        hanakoPoint+=3;
      }else if(judge>0){
        tarouPoint+=3;
      }else{
        hanakoPoint++;
        tarouPoint++;
      }
    } int i=0; int i=0; i 0 i<n i n i++ i++ i {
      String hanakoCard=scan.next();
      String tarouCard=scan.next();
      int judge=hanakoCard.compareTo(tarouCard);
      if(judge<0){
        hanakoPoint+=3;
      }else if(judge>0){
        tarouPoint+=3;
      }else{
        hanakoPoint++;
        tarouPoint++;
      }
    } {
      String hanakoCard=scan.next();
      String tarouCard=scan.next();
      int judge=hanakoCard.compareTo(tarouCard);
      if(judge<0){
        hanakoPoint+=3;
      }else if(judge>0){
        tarouPoint+=3;
      }else{
        hanakoPoint++;
        tarouPoint++;
      }
    } String hanakoCard=scan.next(); hanakoCard scan.next() scan.next scan String tarouCard=scan.next(); tarouCard scan.next() scan.next scan int judge=hanakoCard.compareTo(tarouCard); judge hanakoCard.compareTo(tarouCard) hanakoCard.compareTo hanakoCard tarouCard if(judge<0){
        hanakoPoint+=3;
      }else if(judge>0){
        tarouPoint+=3;
      }else{
        hanakoPoint++;
        tarouPoint++;
      } judge<0 judge 0 {
        hanakoPoint+=3;
      } hanakoPoint+=3 hanakoPoint 3 if(judge>0){
        tarouPoint+=3;
      }else{
        hanakoPoint++;
        tarouPoint++;
      } judge>0 judge 0 {
        tarouPoint+=3;
      } tarouPoint+=3 tarouPoint 3 {
        hanakoPoint++;
        tarouPoint++;
      } hanakoPoint++ hanakoPoint tarouPoint++ tarouPoint System.out.println(tarouPoint+" "+hanakoPoint) System.out.println System.out System System.out tarouPoint+" "+hanakoPoint tarouPoint+" "+hanakoPoint tarouPoint " " hanakoPoint String[] args args
import java.io.*;
import java.util.*;
import java.lang.*;

class Main{
  public static void main(String[] args) throws IOException{
    Scanner scan=new Scanner(System.in);
    int n=Integer.parseInt(scan.next());
    int hanakoPoint=0;
    int tarouPoint=0;
    for(int i=0;i<n;i++){
      String hanakoCard=scan.next();
      String tarouCard=scan.next();
      int judge=hanakoCard.compareTo(tarouCard);
      if(judge<0){
        hanakoPoint+=3;
      }else if(judge>0){
        tarouPoint+=3;
      }else{
        hanakoPoint++;
        tarouPoint++;
      }
    }

    System.out.println(tarouPoint+" "+hanakoPoint);
  }
}
