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

public class Main {
	public static void main(String[] args)throws Exception{
		InputStreamReader isr = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(isr);
    
    	int kaisu = Integer.parseInt( br.readLine());
    	int tpoint = 0;
    	int hpoint = 0;
    	int kurikaesi = 0;
    	for (int i = 0; i < kaisu; i++)
    	{
    		String[] card = br.readLine().split(" ");
    		String taro = card[0];
    		String hanako = card[1];
    		
    		if (taro.length() <= hanako.length())
    			kurikaesi = taro.length();
    		else if (taro.length() > hanako.length())
    			kurikaesi = hanako.length();
    		
    		for (int j = 0; j < kurikaesi; j++)
    		{
    			if (taro.charAt(j) > hanako.charAt(j))
    			{
    				tpoint += 3;
    				break;
    			}
    			else if (taro.charAt(j) < hanako.charAt(j))
    			{
    				hpoint += 3;
					break;
    			}
    			if (j == kurikaesi - 1)
    			{
    				if (taro.length() == hanako.length())
    				{
    					tpoint += 1;
    					hpoint += 1;
    				}
    				else if (taro.length() < hanako.length())
    					hpoint += 3;
    				else if (taro.length() > hanako.length())
    					tpoint += 3;
    			}
    		}
    	}
		System.out.println(tpoint + " " + hpoint);	
	}

} 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{
		InputStreamReader isr = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(isr);
    
    	int kaisu = Integer.parseInt( br.readLine());
    	int tpoint = 0;
    	int hpoint = 0;
    	int kurikaesi = 0;
    	for (int i = 0; i < kaisu; i++)
    	{
    		String[] card = br.readLine().split(" ");
    		String taro = card[0];
    		String hanako = card[1];
    		
    		if (taro.length() <= hanako.length())
    			kurikaesi = taro.length();
    		else if (taro.length() > hanako.length())
    			kurikaesi = hanako.length();
    		
    		for (int j = 0; j < kurikaesi; j++)
    		{
    			if (taro.charAt(j) > hanako.charAt(j))
    			{
    				tpoint += 3;
    				break;
    			}
    			else if (taro.charAt(j) < hanako.charAt(j))
    			{
    				hpoint += 3;
					break;
    			}
    			if (j == kurikaesi - 1)
    			{
    				if (taro.length() == hanako.length())
    				{
    					tpoint += 1;
    					hpoint += 1;
    				}
    				else if (taro.length() < hanako.length())
    					hpoint += 3;
    				else if (taro.length() > hanako.length())
    					tpoint += 3;
    			}
    		}
    	}
		System.out.println(tpoint + " " + hpoint);	
	}

} Main public static void main(String[] args)throws Exception{
		InputStreamReader isr = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(isr);
    
    	int kaisu = Integer.parseInt( br.readLine());
    	int tpoint = 0;
    	int hpoint = 0;
    	int kurikaesi = 0;
    	for (int i = 0; i < kaisu; i++)
    	{
    		String[] card = br.readLine().split(" ");
    		String taro = card[0];
    		String hanako = card[1];
    		
    		if (taro.length() <= hanako.length())
    			kurikaesi = taro.length();
    		else if (taro.length() > hanako.length())
    			kurikaesi = hanako.length();
    		
    		for (int j = 0; j < kurikaesi; j++)
    		{
    			if (taro.charAt(j) > hanako.charAt(j))
    			{
    				tpoint += 3;
    				break;
    			}
    			else if (taro.charAt(j) < hanako.charAt(j))
    			{
    				hpoint += 3;
					break;
    			}
    			if (j == kurikaesi - 1)
    			{
    				if (taro.length() == hanako.length())
    				{
    					tpoint += 1;
    					hpoint += 1;
    				}
    				else if (taro.length() < hanako.length())
    					hpoint += 3;
    				else if (taro.length() > hanako.length())
    					tpoint += 3;
    			}
    		}
    	}
		System.out.println(tpoint + " " + hpoint);	
	} main {
		InputStreamReader isr = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(isr);
    
    	int kaisu = Integer.parseInt( br.readLine());
    	int tpoint = 0;
    	int hpoint = 0;
    	int kurikaesi = 0;
    	for (int i = 0; i < kaisu; i++)
    	{
    		String[] card = br.readLine().split(" ");
    		String taro = card[0];
    		String hanako = card[1];
    		
    		if (taro.length() <= hanako.length())
    			kurikaesi = taro.length();
    		else if (taro.length() > hanako.length())
    			kurikaesi = hanako.length();
    		
    		for (int j = 0; j < kurikaesi; j++)
    		{
    			if (taro.charAt(j) > hanako.charAt(j))
    			{
    				tpoint += 3;
    				break;
    			}
    			else if (taro.charAt(j) < hanako.charAt(j))
    			{
    				hpoint += 3;
					break;
    			}
    			if (j == kurikaesi - 1)
    			{
    				if (taro.length() == hanako.length())
    				{
    					tpoint += 1;
    					hpoint += 1;
    				}
    				else if (taro.length() < hanako.length())
    					hpoint += 3;
    				else if (taro.length() > hanako.length())
    					tpoint += 3;
    			}
    		}
    	}
		System.out.println(tpoint + " " + hpoint);	
	} InputStreamReader isr = new InputStreamReader(System.in); isr new InputStreamReader(System.in) BufferedReader br = new BufferedReader(isr); br new BufferedReader(isr) int kaisu = Integer.parseInt( br.readLine()); kaisu Integer.parseInt( br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int tpoint = 0; tpoint 0 int hpoint = 0; hpoint 0 int kurikaesi = 0; kurikaesi 0 for (int i = 0; i < kaisu; i++)
    	{
    		String[] card = br.readLine().split(" ");
    		String taro = card[0];
    		String hanako = card[1];
    		
    		if (taro.length() <= hanako.length())
    			kurikaesi = taro.length();
    		else if (taro.length() > hanako.length())
    			kurikaesi = hanako.length();
    		
    		for (int j = 0; j < kurikaesi; j++)
    		{
    			if (taro.charAt(j) > hanako.charAt(j))
    			{
    				tpoint += 3;
    				break;
    			}
    			else if (taro.charAt(j) < hanako.charAt(j))
    			{
    				hpoint += 3;
					break;
    			}
    			if (j == kurikaesi - 1)
    			{
    				if (taro.length() == hanako.length())
    				{
    					tpoint += 1;
    					hpoint += 1;
    				}
    				else if (taro.length() < hanako.length())
    					hpoint += 3;
    				else if (taro.length() > hanako.length())
    					tpoint += 3;
    			}
    		}
    	} int i = 0; int i = 0; i 0 i < kaisu i kaisu i++ i++ i {
    		String[] card = br.readLine().split(" ");
    		String taro = card[0];
    		String hanako = card[1];
    		
    		if (taro.length() <= hanako.length())
    			kurikaesi = taro.length();
    		else if (taro.length() > hanako.length())
    			kurikaesi = hanako.length();
    		
    		for (int j = 0; j < kurikaesi; j++)
    		{
    			if (taro.charAt(j) > hanako.charAt(j))
    			{
    				tpoint += 3;
    				break;
    			}
    			else if (taro.charAt(j) < hanako.charAt(j))
    			{
    				hpoint += 3;
					break;
    			}
    			if (j == kurikaesi - 1)
    			{
    				if (taro.length() == hanako.length())
    				{
    					tpoint += 1;
    					hpoint += 1;
    				}
    				else if (taro.length() < hanako.length())
    					hpoint += 3;
    				else if (taro.length() > hanako.length())
    					tpoint += 3;
    			}
    		}
    	} {
    		String[] card = br.readLine().split(" ");
    		String taro = card[0];
    		String hanako = card[1];
    		
    		if (taro.length() <= hanako.length())
    			kurikaesi = taro.length();
    		else if (taro.length() > hanako.length())
    			kurikaesi = hanako.length();
    		
    		for (int j = 0; j < kurikaesi; j++)
    		{
    			if (taro.charAt(j) > hanako.charAt(j))
    			{
    				tpoint += 3;
    				break;
    			}
    			else if (taro.charAt(j) < hanako.charAt(j))
    			{
    				hpoint += 3;
					break;
    			}
    			if (j == kurikaesi - 1)
    			{
    				if (taro.length() == hanako.length())
    				{
    					tpoint += 1;
    					hpoint += 1;
    				}
    				else if (taro.length() < hanako.length())
    					hpoint += 3;
    				else if (taro.length() > hanako.length())
    					tpoint += 3;
    			}
    		}
    	} String[] card = br.readLine().split(" "); card br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " String taro = card[0]; taro card[0] card 0 String hanako = card[1]; hanako card[1] card 1 if (taro.length() <= hanako.length())
    			kurikaesi = taro.length();
    		else if (taro.length() > hanako.length())
    			kurikaesi = hanako.length(); taro.length() <= hanako.length() taro.length() taro.length taro hanako.length() hanako.length hanako kurikaesi = taro.length() kurikaesi taro.length() taro.length taro if (taro.length() > hanako.length())
    			kurikaesi = hanako.length(); taro.length() > hanako.length() taro.length() taro.length taro hanako.length() hanako.length hanako kurikaesi = hanako.length() kurikaesi hanako.length() hanako.length hanako for (int j = 0; j < kurikaesi; j++)
    		{
    			if (taro.charAt(j) > hanako.charAt(j))
    			{
    				tpoint += 3;
    				break;
    			}
    			else if (taro.charAt(j) < hanako.charAt(j))
    			{
    				hpoint += 3;
					break;
    			}
    			if (j == kurikaesi - 1)
    			{
    				if (taro.length() == hanako.length())
    				{
    					tpoint += 1;
    					hpoint += 1;
    				}
    				else if (taro.length() < hanako.length())
    					hpoint += 3;
    				else if (taro.length() > hanako.length())
    					tpoint += 3;
    			}
    		} int j = 0; int j = 0; j 0 j < kurikaesi j kurikaesi j++ j++ j {
    			if (taro.charAt(j) > hanako.charAt(j))
    			{
    				tpoint += 3;
    				break;
    			}
    			else if (taro.charAt(j) < hanako.charAt(j))
    			{
    				hpoint += 3;
					break;
    			}
    			if (j == kurikaesi - 1)
    			{
    				if (taro.length() == hanako.length())
    				{
    					tpoint += 1;
    					hpoint += 1;
    				}
    				else if (taro.length() < hanako.length())
    					hpoint += 3;
    				else if (taro.length() > hanako.length())
    					tpoint += 3;
    			}
    		} {
    			if (taro.charAt(j) > hanako.charAt(j))
    			{
    				tpoint += 3;
    				break;
    			}
    			else if (taro.charAt(j) < hanako.charAt(j))
    			{
    				hpoint += 3;
					break;
    			}
    			if (j == kurikaesi - 1)
    			{
    				if (taro.length() == hanako.length())
    				{
    					tpoint += 1;
    					hpoint += 1;
    				}
    				else if (taro.length() < hanako.length())
    					hpoint += 3;
    				else if (taro.length() > hanako.length())
    					tpoint += 3;
    			}
    		} if (taro.charAt(j) > hanako.charAt(j))
    			{
    				tpoint += 3;
    				break;
    			}
    			else if (taro.charAt(j) < hanako.charAt(j))
    			{
    				hpoint += 3;
					break;
    			} taro.charAt(j) > hanako.charAt(j) taro.charAt(j) taro.charAt taro j hanako.charAt(j) hanako.charAt hanako j {
    				tpoint += 3;
    				break;
    			} tpoint += 3 tpoint 3 break; if (taro.charAt(j) < hanako.charAt(j))
    			{
    				hpoint += 3;
					break;
    			} taro.charAt(j) < hanako.charAt(j) taro.charAt(j) taro.charAt taro j hanako.charAt(j) hanako.charAt hanako j {
    				hpoint += 3;
					break;
    			} hpoint += 3 hpoint 3 break; if (j == kurikaesi - 1)
    			{
    				if (taro.length() == hanako.length())
    				{
    					tpoint += 1;
    					hpoint += 1;
    				}
    				else if (taro.length() < hanako.length())
    					hpoint += 3;
    				else if (taro.length() > hanako.length())
    					tpoint += 3;
    			} j == kurikaesi - 1 j kurikaesi - 1 kurikaesi 1 {
    				if (taro.length() == hanako.length())
    				{
    					tpoint += 1;
    					hpoint += 1;
    				}
    				else if (taro.length() < hanako.length())
    					hpoint += 3;
    				else if (taro.length() > hanako.length())
    					tpoint += 3;
    			} if (taro.length() == hanako.length())
    				{
    					tpoint += 1;
    					hpoint += 1;
    				}
    				else if (taro.length() < hanako.length())
    					hpoint += 3;
    				else if (taro.length() > hanako.length())
    					tpoint += 3; taro.length() == hanako.length() taro.length() taro.length taro hanako.length() hanako.length hanako {
    					tpoint += 1;
    					hpoint += 1;
    				} tpoint += 1 tpoint 1 hpoint += 1 hpoint 1 if (taro.length() < hanako.length())
    					hpoint += 3;
    				else if (taro.length() > hanako.length())
    					tpoint += 3; taro.length() < hanako.length() taro.length() taro.length taro hanako.length() hanako.length hanako hpoint += 3 hpoint 3 if (taro.length() > hanako.length())
    					tpoint += 3; taro.length() > hanako.length() taro.length() taro.length taro hanako.length() hanako.length hanako tpoint += 3 tpoint 3 System.out.println(tpoint + " " + hpoint) System.out.println System.out System System.out tpoint + " " + hpoint tpoint + " " + hpoint tpoint " " hpoint String[] args args public class Main {
	public static void main(String[] args)throws Exception{
		InputStreamReader isr = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(isr);
    
    	int kaisu = Integer.parseInt( br.readLine());
    	int tpoint = 0;
    	int hpoint = 0;
    	int kurikaesi = 0;
    	for (int i = 0; i < kaisu; i++)
    	{
    		String[] card = br.readLine().split(" ");
    		String taro = card[0];
    		String hanako = card[1];
    		
    		if (taro.length() <= hanako.length())
    			kurikaesi = taro.length();
    		else if (taro.length() > hanako.length())
    			kurikaesi = hanako.length();
    		
    		for (int j = 0; j < kurikaesi; j++)
    		{
    			if (taro.charAt(j) > hanako.charAt(j))
    			{
    				tpoint += 3;
    				break;
    			}
    			else if (taro.charAt(j) < hanako.charAt(j))
    			{
    				hpoint += 3;
					break;
    			}
    			if (j == kurikaesi - 1)
    			{
    				if (taro.length() == hanako.length())
    				{
    					tpoint += 1;
    					hpoint += 1;
    				}
    				else if (taro.length() < hanako.length())
    					hpoint += 3;
    				else if (taro.length() > hanako.length())
    					tpoint += 3;
    			}
    		}
    	}
		System.out.println(tpoint + " " + hpoint);	
	}

} public class Main {
	public static void main(String[] args)throws Exception{
		InputStreamReader isr = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(isr);
    
    	int kaisu = Integer.parseInt( br.readLine());
    	int tpoint = 0;
    	int hpoint = 0;
    	int kurikaesi = 0;
    	for (int i = 0; i < kaisu; i++)
    	{
    		String[] card = br.readLine().split(" ");
    		String taro = card[0];
    		String hanako = card[1];
    		
    		if (taro.length() <= hanako.length())
    			kurikaesi = taro.length();
    		else if (taro.length() > hanako.length())
    			kurikaesi = hanako.length();
    		
    		for (int j = 0; j < kurikaesi; j++)
    		{
    			if (taro.charAt(j) > hanako.charAt(j))
    			{
    				tpoint += 3;
    				break;
    			}
    			else if (taro.charAt(j) < hanako.charAt(j))
    			{
    				hpoint += 3;
					break;
    			}
    			if (j == kurikaesi - 1)
    			{
    				if (taro.length() == hanako.length())
    				{
    					tpoint += 1;
    					hpoint += 1;
    				}
    				else if (taro.length() < hanako.length())
    					hpoint += 3;
    				else if (taro.length() > hanako.length())
    					tpoint += 3;
    			}
    		}
    	}
		System.out.println(tpoint + " " + hpoint);	
	}

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

public class Main {
	public static void main(String[] args)throws Exception{
		InputStreamReader isr = new InputStreamReader(System.in);
        BufferedReader br = new BufferedReader(isr);
    
    	int kaisu = Integer.parseInt( br.readLine());
    	int tpoint = 0;
    	int hpoint = 0;
    	int kurikaesi = 0;
    	for (int i = 0; i < kaisu; i++)
    	{
    		String[] card = br.readLine().split(" ");
    		String taro = card[0];
    		String hanako = card[1];
    		
    		if (taro.length() <= hanako.length())
    			kurikaesi = taro.length();
    		else if (taro.length() > hanako.length())
    			kurikaesi = hanako.length();
    		
    		for (int j = 0; j < kurikaesi; j++)
    		{
    			if (taro.charAt(j) > hanako.charAt(j))
    			{
    				tpoint += 3;
    				break;
    			}
    			else if (taro.charAt(j) < hanako.charAt(j))
    			{
    				hpoint += 3;
					break;
    			}
    			if (j == kurikaesi - 1)
    			{
    				if (taro.length() == hanako.length())
    				{
    					tpoint += 1;
    					hpoint += 1;
    				}
    				else if (taro.length() < hanako.length())
    					hpoint += 3;
    				else if (taro.length() > hanako.length())
    					tpoint += 3;
    			}
    		}
    	}
		System.out.println(tpoint + " " + hpoint);	
	}

}