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

public class Main {

	public static void main(String[] args) throws Exception {
        // TODO ?????????????????????????????????????????????
        
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            String line,result="";
            boolean first=true;
            int n=0,i=0,taro=0,hana=0;
            while ((line = br.readLine()) != null) {
            	if(first){
            		n=Integer.parseInt(line);
            		first=false;
            	}else{
            		String[] str=line.split(" ");
            		if(str[0].compareTo(str[1])>0){
            			taro+=3;
            		}else if(str[0].compareTo(str[1])<0){
            			hana+=3;
            		}else{
            			taro+=1;
            			hana+=1;
            		}
            		i++;
            		if(i==n){
            			System.out.println(taro+" "+hana);
            		}
            	}
            	
            }
        }
    }


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

	public static void main(String[] args) throws Exception {
        // TODO ?????????????????????????????????????????????
        
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            String line,result="";
            boolean first=true;
            int n=0,i=0,taro=0,hana=0;
            while ((line = br.readLine()) != null) {
            	if(first){
            		n=Integer.parseInt(line);
            		first=false;
            	}else{
            		String[] str=line.split(" ");
            		if(str[0].compareTo(str[1])>0){
            			taro+=3;
            		}else if(str[0].compareTo(str[1])<0){
            			hana+=3;
            		}else{
            			taro+=1;
            			hana+=1;
            		}
            		i++;
            		if(i==n){
            			System.out.println(taro+" "+hana);
            		}
            	}
            	
            }
        }
    }


} Main public static void main(String[] args) throws Exception {
        // TODO ?????????????????????????????????????????????
        
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            String line,result="";
            boolean first=true;
            int n=0,i=0,taro=0,hana=0;
            while ((line = br.readLine()) != null) {
            	if(first){
            		n=Integer.parseInt(line);
            		first=false;
            	}else{
            		String[] str=line.split(" ");
            		if(str[0].compareTo(str[1])>0){
            			taro+=3;
            		}else if(str[0].compareTo(str[1])<0){
            			hana+=3;
            		}else{
            			taro+=1;
            			hana+=1;
            		}
            		i++;
            		if(i==n){
            			System.out.println(taro+" "+hana);
            		}
            	}
            	
            }
        }
    } main {
        // TODO ?????????????????????????????????????????????
        
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            String line,result="";
            boolean first=true;
            int n=0,i=0,taro=0,hana=0;
            while ((line = br.readLine()) != null) {
            	if(first){
            		n=Integer.parseInt(line);
            		first=false;
            	}else{
            		String[] str=line.split(" ");
            		if(str[0].compareTo(str[1])>0){
            			taro+=3;
            		}else if(str[0].compareTo(str[1])<0){
            			hana+=3;
            		}else{
            			taro+=1;
            			hana+=1;
            		}
            		i++;
            		if(i==n){
            			System.out.println(taro+" "+hana);
            		}
            	}
            	
            }
        }
    } try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            String line,result="";
            boolean first=true;
            int n=0,i=0,taro=0,hana=0;
            while ((line = br.readLine()) != null) {
            	if(first){
            		n=Integer.parseInt(line);
            		first=false;
            	}else{
            		String[] str=line.split(" ");
            		if(str[0].compareTo(str[1])>0){
            			taro+=3;
            		}else if(str[0].compareTo(str[1])<0){
            			hana+=3;
            		}else{
            			taro+=1;
            			hana+=1;
            		}
            		i++;
            		if(i==n){
            			System.out.println(taro+" "+hana);
            		}
            	}
            	
            }
        } {
            String line,result="";
            boolean first=true;
            int n=0,i=0,taro=0,hana=0;
            while ((line = br.readLine()) != null) {
            	if(first){
            		n=Integer.parseInt(line);
            		first=false;
            	}else{
            		String[] str=line.split(" ");
            		if(str[0].compareTo(str[1])>0){
            			taro+=3;
            		}else if(str[0].compareTo(str[1])<0){
            			hana+=3;
            		}else{
            			taro+=1;
            			hana+=1;
            		}
            		i++;
            		if(i==n){
            			System.out.println(taro+" "+hana);
            		}
            	}
            	
            }
        } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)) BufferedReader br = new BufferedReader(new InputStreamReader(System.in)) new BufferedReader(new InputStreamReader(System.in)) String line line result=""; result "" boolean first=true; first true int n=0 n 0 i=0 i 0 taro=0 taro 0 hana=0; hana 0 while ((line = br.readLine()) != null) {
            	if(first){
            		n=Integer.parseInt(line);
            		first=false;
            	}else{
            		String[] str=line.split(" ");
            		if(str[0].compareTo(str[1])>0){
            			taro+=3;
            		}else if(str[0].compareTo(str[1])<0){
            			hana+=3;
            		}else{
            			taro+=1;
            			hana+=1;
            		}
            		i++;
            		if(i==n){
            			System.out.println(taro+" "+hana);
            		}
            	}
            	
            } (line = br.readLine()) != null (line = br.readLine()) line br.readLine() br.readLine br null {
            	if(first){
            		n=Integer.parseInt(line);
            		first=false;
            	}else{
            		String[] str=line.split(" ");
            		if(str[0].compareTo(str[1])>0){
            			taro+=3;
            		}else if(str[0].compareTo(str[1])<0){
            			hana+=3;
            		}else{
            			taro+=1;
            			hana+=1;
            		}
            		i++;
            		if(i==n){
            			System.out.println(taro+" "+hana);
            		}
            	}
            	
            } if(first){
            		n=Integer.parseInt(line);
            		first=false;
            	}else{
            		String[] str=line.split(" ");
            		if(str[0].compareTo(str[1])>0){
            			taro+=3;
            		}else if(str[0].compareTo(str[1])<0){
            			hana+=3;
            		}else{
            			taro+=1;
            			hana+=1;
            		}
            		i++;
            		if(i==n){
            			System.out.println(taro+" "+hana);
            		}
            	} first {
            		n=Integer.parseInt(line);
            		first=false;
            	} n=Integer.parseInt(line) n Integer.parseInt(line) Integer.parseInt Integer line first=false first false {
            		String[] str=line.split(" ");
            		if(str[0].compareTo(str[1])>0){
            			taro+=3;
            		}else if(str[0].compareTo(str[1])<0){
            			hana+=3;
            		}else{
            			taro+=1;
            			hana+=1;
            		}
            		i++;
            		if(i==n){
            			System.out.println(taro+" "+hana);
            		}
            	} String[] str=line.split(" "); str line.split(" ") line.split line " " if(str[0].compareTo(str[1])>0){
            			taro+=3;
            		}else if(str[0].compareTo(str[1])<0){
            			hana+=3;
            		}else{
            			taro+=1;
            			hana+=1;
            		} str[0].compareTo(str[1])>0 str[0].compareTo(str[1]) str[0].compareTo str[0] str 0 str[1] str 1 0 {
            			taro+=3;
            		} taro+=3 taro 3 if(str[0].compareTo(str[1])<0){
            			hana+=3;
            		}else{
            			taro+=1;
            			hana+=1;
            		} str[0].compareTo(str[1])<0 str[0].compareTo(str[1]) str[0].compareTo str[0] str 0 str[1] str 1 0 {
            			hana+=3;
            		} hana+=3 hana 3 {
            			taro+=1;
            			hana+=1;
            		} taro+=1 taro 1 hana+=1 hana 1 i++ i if(i==n){
            			System.out.println(taro+" "+hana);
            		} i==n i n {
            			System.out.println(taro+" "+hana);
            		} System.out.println(taro+" "+hana) System.out.println System.out System System.out taro+" "+hana taro+" "+hana taro " " hana String[] args args public class Main {

	public static void main(String[] args) throws Exception {
        // TODO ?????????????????????????????????????????????
        
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            String line,result="";
            boolean first=true;
            int n=0,i=0,taro=0,hana=0;
            while ((line = br.readLine()) != null) {
            	if(first){
            		n=Integer.parseInt(line);
            		first=false;
            	}else{
            		String[] str=line.split(" ");
            		if(str[0].compareTo(str[1])>0){
            			taro+=3;
            		}else if(str[0].compareTo(str[1])<0){
            			hana+=3;
            		}else{
            			taro+=1;
            			hana+=1;
            		}
            		i++;
            		if(i==n){
            			System.out.println(taro+" "+hana);
            		}
            	}
            	
            }
        }
    }


} public class Main {

	public static void main(String[] args) throws Exception {
        // TODO ?????????????????????????????????????????????
        
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            String line,result="";
            boolean first=true;
            int n=0,i=0,taro=0,hana=0;
            while ((line = br.readLine()) != null) {
            	if(first){
            		n=Integer.parseInt(line);
            		first=false;
            	}else{
            		String[] str=line.split(" ");
            		if(str[0].compareTo(str[1])>0){
            			taro+=3;
            		}else if(str[0].compareTo(str[1])<0){
            			hana+=3;
            		}else{
            			taro+=1;
            			hana+=1;
            		}
            		i++;
            		if(i==n){
            			System.out.println(taro+" "+hana);
            		}
            	}
            	
            }
        }
    }


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

public class Main {

	public static void main(String[] args) throws Exception {
        // TODO ?????????????????????????????????????????????
        
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            String line,result="";
            boolean first=true;
            int n=0,i=0,taro=0,hana=0;
            while ((line = br.readLine()) != null) {
            	if(first){
            		n=Integer.parseInt(line);
            		first=false;
            	}else{
            		String[] str=line.split(" ");
            		if(str[0].compareTo(str[1])>0){
            			taro+=3;
            		}else if(str[0].compareTo(str[1])<0){
            			hana+=3;
            		}else{
            			taro+=1;
            			hana+=1;
            		}
            		i++;
            		if(i==n){
            			System.out.println(taro+" "+hana);
            		}
            	}
            	
            }
        }
    }


}