import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
 
public class Main{

	public static void main(String[] args) throws IOException
	{
		int n,nTaro=0,nHana=0;
		String str;

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in) );
		
        n = Integer.parseInt(br.readLine() );
        
        for(int i=0; i<n; i++)
        {
            str = br.readLine();
            
            String[] strTH = str.split(" ",2);
            
            if(0 < strTH[0].compareTo(strTH[1]) ) nTaro += 3;
            else if(strTH[0].equals(strTH[1]) )
            {
                nTaro++;
                nHana++;
            }
            else nHana += 3;
            
        }
        
        System.out.println(nTaro + " " +nHana);
            
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main{

	public static void main(String[] args) throws IOException
	{
		int n,nTaro=0,nHana=0;
		String str;

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in) );
		
        n = Integer.parseInt(br.readLine() );
        
        for(int i=0; i<n; i++)
        {
            str = br.readLine();
            
            String[] strTH = str.split(" ",2);
            
            if(0 < strTH[0].compareTo(strTH[1]) ) nTaro += 3;
            else if(strTH[0].equals(strTH[1]) )
            {
                nTaro++;
                nHana++;
            }
            else nHana += 3;
            
        }
        
        System.out.println(nTaro + " " +nHana);
            
	}
} Main public static void main(String[] args) throws IOException
	{
		int n,nTaro=0,nHana=0;
		String str;

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in) );
		
        n = Integer.parseInt(br.readLine() );
        
        for(int i=0; i<n; i++)
        {
            str = br.readLine();
            
            String[] strTH = str.split(" ",2);
            
            if(0 < strTH[0].compareTo(strTH[1]) ) nTaro += 3;
            else if(strTH[0].equals(strTH[1]) )
            {
                nTaro++;
                nHana++;
            }
            else nHana += 3;
            
        }
        
        System.out.println(nTaro + " " +nHana);
            
	} main {
		int n,nTaro=0,nHana=0;
		String str;

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in) );
		
        n = Integer.parseInt(br.readLine() );
        
        for(int i=0; i<n; i++)
        {
            str = br.readLine();
            
            String[] strTH = str.split(" ",2);
            
            if(0 < strTH[0].compareTo(strTH[1]) ) nTaro += 3;
            else if(strTH[0].equals(strTH[1]) )
            {
                nTaro++;
                nHana++;
            }
            else nHana += 3;
            
        }
        
        System.out.println(nTaro + " " +nHana);
            
	} int n n nTaro=0 nTaro 0 nHana=0; nHana 0 String str; str BufferedReader br = new BufferedReader(new InputStreamReader(System.in) ); br new BufferedReader(new InputStreamReader(System.in) ) n = Integer.parseInt(br.readLine() ) n Integer.parseInt(br.readLine() ) Integer.parseInt Integer br.readLine() br.readLine br for(int i=0; i<n; i++)
        {
            str = br.readLine();
            
            String[] strTH = str.split(" ",2);
            
            if(0 < strTH[0].compareTo(strTH[1]) ) nTaro += 3;
            else if(strTH[0].equals(strTH[1]) )
            {
                nTaro++;
                nHana++;
            }
            else nHana += 3;
            
        } int i=0; int i=0; i 0 i<n i n i++ i++ i {
            str = br.readLine();
            
            String[] strTH = str.split(" ",2);
            
            if(0 < strTH[0].compareTo(strTH[1]) ) nTaro += 3;
            else if(strTH[0].equals(strTH[1]) )
            {
                nTaro++;
                nHana++;
            }
            else nHana += 3;
            
        } {
            str = br.readLine();
            
            String[] strTH = str.split(" ",2);
            
            if(0 < strTH[0].compareTo(strTH[1]) ) nTaro += 3;
            else if(strTH[0].equals(strTH[1]) )
            {
                nTaro++;
                nHana++;
            }
            else nHana += 3;
            
        } str = br.readLine() str br.readLine() br.readLine br String[] strTH = str.split(" ",2); strTH str.split(" ",2) str.split str " " 2 if(0 < strTH[0].compareTo(strTH[1]) ) nTaro += 3;
            else if(strTH[0].equals(strTH[1]) )
            {
                nTaro++;
                nHana++;
            }
            else nHana += 3; 0 < strTH[0].compareTo(strTH[1]) 0 strTH[0].compareTo(strTH[1]) strTH[0].compareTo strTH[0] strTH 0 strTH[1] strTH 1 nTaro += 3 nTaro 3 if(strTH[0].equals(strTH[1]) )
            {
                nTaro++;
                nHana++;
            }
            else nHana += 3; strTH[0].equals(strTH[1]) strTH[0].equals strTH[0] strTH 0 strTH[1] strTH 1 {
                nTaro++;
                nHana++;
            } nTaro++ nTaro nHana++ nHana nHana += 3 nHana 3 System.out.println(nTaro + " " +nHana) System.out.println System.out System System.out nTaro + " " +nHana nTaro + " " +nHana nTaro " " nHana String[] args args public class Main{

	public static void main(String[] args) throws IOException
	{
		int n,nTaro=0,nHana=0;
		String str;

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in) );
		
        n = Integer.parseInt(br.readLine() );
        
        for(int i=0; i<n; i++)
        {
            str = br.readLine();
            
            String[] strTH = str.split(" ",2);
            
            if(0 < strTH[0].compareTo(strTH[1]) ) nTaro += 3;
            else if(strTH[0].equals(strTH[1]) )
            {
                nTaro++;
                nHana++;
            }
            else nHana += 3;
            
        }
        
        System.out.println(nTaro + " " +nHana);
            
	}
} public class Main{

	public static void main(String[] args) throws IOException
	{
		int n,nTaro=0,nHana=0;
		String str;

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in) );
		
        n = Integer.parseInt(br.readLine() );
        
        for(int i=0; i<n; i++)
        {
            str = br.readLine();
            
            String[] strTH = str.split(" ",2);
            
            if(0 < strTH[0].compareTo(strTH[1]) ) nTaro += 3;
            else if(strTH[0].equals(strTH[1]) )
            {
                nTaro++;
                nHana++;
            }
            else nHana += 3;
            
        }
        
        System.out.println(nTaro + " " +nHana);
            
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
 
public class Main{

	public static void main(String[] args) throws IOException
	{
		int n,nTaro=0,nHana=0;
		String str;

		BufferedReader br = new BufferedReader(new InputStreamReader(System.in) );
		
        n = Integer.parseInt(br.readLine() );
        
        for(int i=0; i<n; i++)
        {
            str = br.readLine();
            
            String[] strTH = str.split(" ",2);
            
            if(0 < strTH[0].compareTo(strTH[1]) ) nTaro += 3;
            else if(strTH[0].equals(strTH[1]) )
            {
                nTaro++;
                nHana++;
            }
            else nHana += 3;
            
        }
        
        System.out.println(nTaro + " " +nHana);
            
	}
}