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

public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
		
		int n = Integer.parseInt(input.readLine());
		int i = 0 , taroPo = 0 , hanakoPo = 0 ;
		while(i != n){
			i++;
			String str = input.readLine();
			String taro = str.substring(0,str.indexOf(' '));
			String hanako = str.substring(str.indexOf(' ') +1);
			
			if(taro.compareTo(hanako) < 0) hanakoPo += 3;
			else if(taro.compareTo(hanako) > 0) taroPo += 3;
			else { 
				taroPo ++;
				hanakoPo ++;
			}
		}
		
		System.out.println(taroPo + " " + hanakoPo);
		
	}

} 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 {
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
		
		int n = Integer.parseInt(input.readLine());
		int i = 0 , taroPo = 0 , hanakoPo = 0 ;
		while(i != n){
			i++;
			String str = input.readLine();
			String taro = str.substring(0,str.indexOf(' '));
			String hanako = str.substring(str.indexOf(' ') +1);
			
			if(taro.compareTo(hanako) < 0) hanakoPo += 3;
			else if(taro.compareTo(hanako) > 0) taroPo += 3;
			else { 
				taroPo ++;
				hanakoPo ++;
			}
		}
		
		System.out.println(taroPo + " " + hanakoPo);
		
	}

} Main public static void main(String[] args) throws IOException {
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
		
		int n = Integer.parseInt(input.readLine());
		int i = 0 , taroPo = 0 , hanakoPo = 0 ;
		while(i != n){
			i++;
			String str = input.readLine();
			String taro = str.substring(0,str.indexOf(' '));
			String hanako = str.substring(str.indexOf(' ') +1);
			
			if(taro.compareTo(hanako) < 0) hanakoPo += 3;
			else if(taro.compareTo(hanako) > 0) taroPo += 3;
			else { 
				taroPo ++;
				hanakoPo ++;
			}
		}
		
		System.out.println(taroPo + " " + hanakoPo);
		
	} main {
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
		
		int n = Integer.parseInt(input.readLine());
		int i = 0 , taroPo = 0 , hanakoPo = 0 ;
		while(i != n){
			i++;
			String str = input.readLine();
			String taro = str.substring(0,str.indexOf(' '));
			String hanako = str.substring(str.indexOf(' ') +1);
			
			if(taro.compareTo(hanako) < 0) hanakoPo += 3;
			else if(taro.compareTo(hanako) > 0) taroPo += 3;
			else { 
				taroPo ++;
				hanakoPo ++;
			}
		}
		
		System.out.println(taroPo + " " + hanakoPo);
		
	} BufferedReader input = new BufferedReader(new InputStreamReader(System.in)); input new BufferedReader(new InputStreamReader(System.in)) int n = Integer.parseInt(input.readLine()); n Integer.parseInt(input.readLine()) Integer.parseInt Integer input.readLine() input.readLine input int i = 0 i 0 taroPo = 0 taroPo 0 hanakoPo = 0 ; hanakoPo 0 while(i != n){
			i++;
			String str = input.readLine();
			String taro = str.substring(0,str.indexOf(' '));
			String hanako = str.substring(str.indexOf(' ') +1);
			
			if(taro.compareTo(hanako) < 0) hanakoPo += 3;
			else if(taro.compareTo(hanako) > 0) taroPo += 3;
			else { 
				taroPo ++;
				hanakoPo ++;
			}
		} i != n i n {
			i++;
			String str = input.readLine();
			String taro = str.substring(0,str.indexOf(' '));
			String hanako = str.substring(str.indexOf(' ') +1);
			
			if(taro.compareTo(hanako) < 0) hanakoPo += 3;
			else if(taro.compareTo(hanako) > 0) taroPo += 3;
			else { 
				taroPo ++;
				hanakoPo ++;
			}
		} i++ i String str = input.readLine(); str input.readLine() input.readLine input String taro = str.substring(0,str.indexOf(' ')); taro str.substring(0,str.indexOf(' ')) str.substring str 0 str.indexOf(' ') str.indexOf str ' ' String hanako = str.substring(str.indexOf(' ') +1); hanako str.substring(str.indexOf(' ') +1) str.substring str str.indexOf(' ') +1 str.indexOf(' ') str.indexOf str ' ' 1 if(taro.compareTo(hanako) < 0) hanakoPo += 3;
			else if(taro.compareTo(hanako) > 0) taroPo += 3;
			else { 
				taroPo ++;
				hanakoPo ++;
			} taro.compareTo(hanako) < 0 taro.compareTo(hanako) taro.compareTo taro hanako 0 hanakoPo += 3 hanakoPo 3 if(taro.compareTo(hanako) > 0) taroPo += 3;
			else { 
				taroPo ++;
				hanakoPo ++;
			} taro.compareTo(hanako) > 0 taro.compareTo(hanako) taro.compareTo taro hanako 0 taroPo += 3 taroPo 3 { 
				taroPo ++;
				hanakoPo ++;
			} taroPo ++ taroPo hanakoPo ++ hanakoPo System.out.println(taroPo + " " + hanakoPo) System.out.println System.out System System.out taroPo + " " + hanakoPo taroPo + " " + hanakoPo taroPo " " hanakoPo String[] args args public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
		
		int n = Integer.parseInt(input.readLine());
		int i = 0 , taroPo = 0 , hanakoPo = 0 ;
		while(i != n){
			i++;
			String str = input.readLine();
			String taro = str.substring(0,str.indexOf(' '));
			String hanako = str.substring(str.indexOf(' ') +1);
			
			if(taro.compareTo(hanako) < 0) hanakoPo += 3;
			else if(taro.compareTo(hanako) > 0) taroPo += 3;
			else { 
				taroPo ++;
				hanakoPo ++;
			}
		}
		
		System.out.println(taroPo + " " + hanakoPo);
		
	}

} public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
		
		int n = Integer.parseInt(input.readLine());
		int i = 0 , taroPo = 0 , hanakoPo = 0 ;
		while(i != n){
			i++;
			String str = input.readLine();
			String taro = str.substring(0,str.indexOf(' '));
			String hanako = str.substring(str.indexOf(' ') +1);
			
			if(taro.compareTo(hanako) < 0) hanakoPo += 3;
			else if(taro.compareTo(hanako) > 0) taroPo += 3;
			else { 
				taroPo ++;
				hanakoPo ++;
			}
		}
		
		System.out.println(taroPo + " " + hanakoPo);
		
	}

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

public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
		
		int n = Integer.parseInt(input.readLine());
		int i = 0 , taroPo = 0 , hanakoPo = 0 ;
		while(i != n){
			i++;
			String str = input.readLine();
			String taro = str.substring(0,str.indexOf(' '));
			String hanako = str.substring(str.indexOf(' ') +1);
			
			if(taro.compareTo(hanako) < 0) hanakoPo += 3;
			else if(taro.compareTo(hanako) > 0) taroPo += 3;
			else { 
				taroPo ++;
				hanakoPo ++;
			}
		}
		
		System.out.println(taroPo + " " + hanakoPo);
		
	}

}