

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Main{
  public static void main(String args[]) throws IOException{
   BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
   int n = Integer.parseInt(br.readLine());
   int TarouP = 0;
   int HanakoP = 0;

   for(int i = 0; i < n;i++){

	   String[] token = br.readLine().split(" ");

	   if(  token[0].compareTo( token[1] ) > 0 ){//??????:0?????±???:1

	       TarouP += 3;

	   }else if(token[0].compareTo( token[1] ) < 0 ){

		   HanakoP += 3;

	   }else{
		   TarouP++;
		   HanakoP++;
	   }


   }

   System.out.println(TarouP+" "+HanakoP);

  }
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io class Main{
  public static void main(String args[]) throws IOException{
   BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
   int n = Integer.parseInt(br.readLine());
   int TarouP = 0;
   int HanakoP = 0;

   for(int i = 0; i < n;i++){

	   String[] token = br.readLine().split(" ");

	   if(  token[0].compareTo( token[1] ) > 0 ){//??????:0?????±???:1

	       TarouP += 3;

	   }else if(token[0].compareTo( token[1] ) < 0 ){

		   HanakoP += 3;

	   }else{
		   TarouP++;
		   HanakoP++;
	   }


   }

   System.out.println(TarouP+" "+HanakoP);

  }
} Main public static void main(String args[]) throws IOException{
   BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
   int n = Integer.parseInt(br.readLine());
   int TarouP = 0;
   int HanakoP = 0;

   for(int i = 0; i < n;i++){

	   String[] token = br.readLine().split(" ");

	   if(  token[0].compareTo( token[1] ) > 0 ){//??????:0?????±???:1

	       TarouP += 3;

	   }else if(token[0].compareTo( token[1] ) < 0 ){

		   HanakoP += 3;

	   }else{
		   TarouP++;
		   HanakoP++;
	   }


   }

   System.out.println(TarouP+" "+HanakoP);

  } main {
   BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
   int n = Integer.parseInt(br.readLine());
   int TarouP = 0;
   int HanakoP = 0;

   for(int i = 0; i < n;i++){

	   String[] token = br.readLine().split(" ");

	   if(  token[0].compareTo( token[1] ) > 0 ){//??????:0?????±???:1

	       TarouP += 3;

	   }else if(token[0].compareTo( token[1] ) < 0 ){

		   HanakoP += 3;

	   }else{
		   TarouP++;
		   HanakoP++;
	   }


   }

   System.out.println(TarouP+" "+HanakoP);

  } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int TarouP = 0; TarouP 0 int HanakoP = 0; HanakoP 0 for(int i = 0; i < n;i++){

	   String[] token = br.readLine().split(" ");

	   if(  token[0].compareTo( token[1] ) > 0 ){//??????:0?????±???:1

	       TarouP += 3;

	   }else if(token[0].compareTo( token[1] ) < 0 ){

		   HanakoP += 3;

	   }else{
		   TarouP++;
		   HanakoP++;
	   }


   } int i = 0; int i = 0; i 0 i < n i n i++ i++ i {

	   String[] token = br.readLine().split(" ");

	   if(  token[0].compareTo( token[1] ) > 0 ){//??????:0?????±???:1

	       TarouP += 3;

	   }else if(token[0].compareTo( token[1] ) < 0 ){

		   HanakoP += 3;

	   }else{
		   TarouP++;
		   HanakoP++;
	   }


   } {

	   String[] token = br.readLine().split(" ");

	   if(  token[0].compareTo( token[1] ) > 0 ){//??????:0?????±???:1

	       TarouP += 3;

	   }else if(token[0].compareTo( token[1] ) < 0 ){

		   HanakoP += 3;

	   }else{
		   TarouP++;
		   HanakoP++;
	   }


   } String[] token = br.readLine().split(" "); token br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " if(  token[0].compareTo( token[1] ) > 0 ){//??????:0?????±???:1

	       TarouP += 3;

	   }else if(token[0].compareTo( token[1] ) < 0 ){

		   HanakoP += 3;

	   }else{
		   TarouP++;
		   HanakoP++;
	   } token[0].compareTo( token[1] ) > 0 token[0].compareTo( token[1] ) token[0].compareTo token[0] token 0 token[1] token 1 0 {//??????:0?????±???:1

	       TarouP += 3;

	   } TarouP += 3 TarouP 3 if(token[0].compareTo( token[1] ) < 0 ){

		   HanakoP += 3;

	   }else{
		   TarouP++;
		   HanakoP++;
	   } token[0].compareTo( token[1] ) < 0 token[0].compareTo( token[1] ) token[0].compareTo token[0] token 0 token[1] token 1 0 {

		   HanakoP += 3;

	   } HanakoP += 3 HanakoP 3 {
		   TarouP++;
		   HanakoP++;
	   } TarouP++ TarouP HanakoP++ HanakoP System.out.println(TarouP+" "+HanakoP) System.out.println System.out System System.out TarouP+" "+HanakoP TarouP+" "+HanakoP TarouP " " HanakoP String args[] args


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Main{
  public static void main(String args[]) throws IOException{
   BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
   int n = Integer.parseInt(br.readLine());
   int TarouP = 0;
   int HanakoP = 0;

   for(int i = 0; i < n;i++){

	   String[] token = br.readLine().split(" ");

	   if(  token[0].compareTo( token[1] ) > 0 ){//??????:0?????±???:1

	       TarouP += 3;

	   }else if(token[0].compareTo( token[1] ) < 0 ){

		   HanakoP += 3;

	   }else{
		   TarouP++;
		   HanakoP++;
	   }


   }

   System.out.println(TarouP+" "+HanakoP);

  }
}