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



public class Main{
	public static void main(String[] args){

		BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));
		int num;
		int point_Taro=0;
		int point_Hanako=0;
		int Taro, Hanako;
		char[] charstr_Taro;
		char[] charstr_Hanako;
		String str;
		String[] str_array;
		int len_Taro, len_Hanako;


		try{

			num=Integer.parseInt(reader.readLine());

			for(int i=0;i<num;i++){
				str=reader.readLine();
				str_array=str.split(" ");
				charstr_Taro=str_array[0].toCharArray();
				charstr_Hanako=str_array[1].toCharArray();

				len_Taro=charstr_Taro.length;
				len_Hanako=charstr_Hanako.length;


				for(int j=0;j<len_Taro&&j<len_Hanako;j++){//???????????????????????????????????????
					Taro=charstr_Taro[j];
					Hanako=charstr_Hanako[j];

					if(Taro>Hanako){

						point_Taro+=3;
					    break;
					}else if(Taro<Hanako){

						point_Hanako+=3;
					    break;
					}

					if(j==len_Taro-1 && len_Taro<len_Hanako){
						point_Hanako+=3;
						break;
					}else if(j==len_Hanako-1 && len_Taro>len_Hanako){
						point_Taro+=3;
						break;
					}else if(j==len_Taro-1&&len_Taro==len_Hanako){
					point_Hanako++;
					point_Taro++;
					break;}
				}



			}//num?????°????????????
			System.out.println(point_Taro+" "+point_Hanako);

		}catch(IOException e){
			System.out.print(e);
		}
	}

} 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){

		BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));
		int num;
		int point_Taro=0;
		int point_Hanako=0;
		int Taro, Hanako;
		char[] charstr_Taro;
		char[] charstr_Hanako;
		String str;
		String[] str_array;
		int len_Taro, len_Hanako;


		try{

			num=Integer.parseInt(reader.readLine());

			for(int i=0;i<num;i++){
				str=reader.readLine();
				str_array=str.split(" ");
				charstr_Taro=str_array[0].toCharArray();
				charstr_Hanako=str_array[1].toCharArray();

				len_Taro=charstr_Taro.length;
				len_Hanako=charstr_Hanako.length;


				for(int j=0;j<len_Taro&&j<len_Hanako;j++){//???????????????????????????????????????
					Taro=charstr_Taro[j];
					Hanako=charstr_Hanako[j];

					if(Taro>Hanako){

						point_Taro+=3;
					    break;
					}else if(Taro<Hanako){

						point_Hanako+=3;
					    break;
					}

					if(j==len_Taro-1 && len_Taro<len_Hanako){
						point_Hanako+=3;
						break;
					}else if(j==len_Hanako-1 && len_Taro>len_Hanako){
						point_Taro+=3;
						break;
					}else if(j==len_Taro-1&&len_Taro==len_Hanako){
					point_Hanako++;
					point_Taro++;
					break;}
				}



			}//num?????°????????????
			System.out.println(point_Taro+" "+point_Hanako);

		}catch(IOException e){
			System.out.print(e);
		}
	}

} Main public static void main(String[] args){

		BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));
		int num;
		int point_Taro=0;
		int point_Hanako=0;
		int Taro, Hanako;
		char[] charstr_Taro;
		char[] charstr_Hanako;
		String str;
		String[] str_array;
		int len_Taro, len_Hanako;


		try{

			num=Integer.parseInt(reader.readLine());

			for(int i=0;i<num;i++){
				str=reader.readLine();
				str_array=str.split(" ");
				charstr_Taro=str_array[0].toCharArray();
				charstr_Hanako=str_array[1].toCharArray();

				len_Taro=charstr_Taro.length;
				len_Hanako=charstr_Hanako.length;


				for(int j=0;j<len_Taro&&j<len_Hanako;j++){//???????????????????????????????????????
					Taro=charstr_Taro[j];
					Hanako=charstr_Hanako[j];

					if(Taro>Hanako){

						point_Taro+=3;
					    break;
					}else if(Taro<Hanako){

						point_Hanako+=3;
					    break;
					}

					if(j==len_Taro-1 && len_Taro<len_Hanako){
						point_Hanako+=3;
						break;
					}else if(j==len_Hanako-1 && len_Taro>len_Hanako){
						point_Taro+=3;
						break;
					}else if(j==len_Taro-1&&len_Taro==len_Hanako){
					point_Hanako++;
					point_Taro++;
					break;}
				}



			}//num?????°????????????
			System.out.println(point_Taro+" "+point_Hanako);

		}catch(IOException e){
			System.out.print(e);
		}
	} main {

		BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));
		int num;
		int point_Taro=0;
		int point_Hanako=0;
		int Taro, Hanako;
		char[] charstr_Taro;
		char[] charstr_Hanako;
		String str;
		String[] str_array;
		int len_Taro, len_Hanako;


		try{

			num=Integer.parseInt(reader.readLine());

			for(int i=0;i<num;i++){
				str=reader.readLine();
				str_array=str.split(" ");
				charstr_Taro=str_array[0].toCharArray();
				charstr_Hanako=str_array[1].toCharArray();

				len_Taro=charstr_Taro.length;
				len_Hanako=charstr_Hanako.length;


				for(int j=0;j<len_Taro&&j<len_Hanako;j++){//???????????????????????????????????????
					Taro=charstr_Taro[j];
					Hanako=charstr_Hanako[j];

					if(Taro>Hanako){

						point_Taro+=3;
					    break;
					}else if(Taro<Hanako){

						point_Hanako+=3;
					    break;
					}

					if(j==len_Taro-1 && len_Taro<len_Hanako){
						point_Hanako+=3;
						break;
					}else if(j==len_Hanako-1 && len_Taro>len_Hanako){
						point_Taro+=3;
						break;
					}else if(j==len_Taro-1&&len_Taro==len_Hanako){
					point_Hanako++;
					point_Taro++;
					break;}
				}



			}//num?????°????????????
			System.out.println(point_Taro+" "+point_Hanako);

		}catch(IOException e){
			System.out.print(e);
		}
	} BufferedReader reader=new BufferedReader(new InputStreamReader(System.in)); reader new BufferedReader(new InputStreamReader(System.in)) int num; num int point_Taro=0; point_Taro 0 int point_Hanako=0; point_Hanako 0 int Taro Taro Hanako; Hanako char[] charstr_Taro; charstr_Taro char[] charstr_Hanako; charstr_Hanako String str; str String[] str_array; str_array int len_Taro len_Taro len_Hanako; len_Hanako try{

			num=Integer.parseInt(reader.readLine());

			for(int i=0;i<num;i++){
				str=reader.readLine();
				str_array=str.split(" ");
				charstr_Taro=str_array[0].toCharArray();
				charstr_Hanako=str_array[1].toCharArray();

				len_Taro=charstr_Taro.length;
				len_Hanako=charstr_Hanako.length;


				for(int j=0;j<len_Taro&&j<len_Hanako;j++){//???????????????????????????????????????
					Taro=charstr_Taro[j];
					Hanako=charstr_Hanako[j];

					if(Taro>Hanako){

						point_Taro+=3;
					    break;
					}else if(Taro<Hanako){

						point_Hanako+=3;
					    break;
					}

					if(j==len_Taro-1 && len_Taro<len_Hanako){
						point_Hanako+=3;
						break;
					}else if(j==len_Hanako-1 && len_Taro>len_Hanako){
						point_Taro+=3;
						break;
					}else if(j==len_Taro-1&&len_Taro==len_Hanako){
					point_Hanako++;
					point_Taro++;
					break;}
				}



			}//num?????°????????????
			System.out.println(point_Taro+" "+point_Hanako);

		}catch(IOException e){
			System.out.print(e);
		} catch(IOException e){
			System.out.print(e);
		} IOException e {
			System.out.print(e);
		} System.out.print(e) System.out.print System.out System System.out e {

			num=Integer.parseInt(reader.readLine());

			for(int i=0;i<num;i++){
				str=reader.readLine();
				str_array=str.split(" ");
				charstr_Taro=str_array[0].toCharArray();
				charstr_Hanako=str_array[1].toCharArray();

				len_Taro=charstr_Taro.length;
				len_Hanako=charstr_Hanako.length;


				for(int j=0;j<len_Taro&&j<len_Hanako;j++){//???????????????????????????????????????
					Taro=charstr_Taro[j];
					Hanako=charstr_Hanako[j];

					if(Taro>Hanako){

						point_Taro+=3;
					    break;
					}else if(Taro<Hanako){

						point_Hanako+=3;
					    break;
					}

					if(j==len_Taro-1 && len_Taro<len_Hanako){
						point_Hanako+=3;
						break;
					}else if(j==len_Hanako-1 && len_Taro>len_Hanako){
						point_Taro+=3;
						break;
					}else if(j==len_Taro-1&&len_Taro==len_Hanako){
					point_Hanako++;
					point_Taro++;
					break;}
				}



			}//num?????°????????????
			System.out.println(point_Taro+" "+point_Hanako);

		} num=Integer.parseInt(reader.readLine()) num Integer.parseInt(reader.readLine()) Integer.parseInt Integer reader.readLine() reader.readLine reader for(int i=0;i<num;i++){
				str=reader.readLine();
				str_array=str.split(" ");
				charstr_Taro=str_array[0].toCharArray();
				charstr_Hanako=str_array[1].toCharArray();

				len_Taro=charstr_Taro.length;
				len_Hanako=charstr_Hanako.length;


				for(int j=0;j<len_Taro&&j<len_Hanako;j++){//???????????????????????????????????????
					Taro=charstr_Taro[j];
					Hanako=charstr_Hanako[j];

					if(Taro>Hanako){

						point_Taro+=3;
					    break;
					}else if(Taro<Hanako){

						point_Hanako+=3;
					    break;
					}

					if(j==len_Taro-1 && len_Taro<len_Hanako){
						point_Hanako+=3;
						break;
					}else if(j==len_Hanako-1 && len_Taro>len_Hanako){
						point_Taro+=3;
						break;
					}else if(j==len_Taro-1&&len_Taro==len_Hanako){
					point_Hanako++;
					point_Taro++;
					break;}
				}



			}//num?????°???????????? int i=0; int i=0; i 0 i<num i num i++ i++ i {
				str=reader.readLine();
				str_array=str.split(" ");
				charstr_Taro=str_array[0].toCharArray();
				charstr_Hanako=str_array[1].toCharArray();

				len_Taro=charstr_Taro.length;
				len_Hanako=charstr_Hanako.length;


				for(int j=0;j<len_Taro&&j<len_Hanako;j++){//???????????????????????????????????????
					Taro=charstr_Taro[j];
					Hanako=charstr_Hanako[j];

					if(Taro>Hanako){

						point_Taro+=3;
					    break;
					}else if(Taro<Hanako){

						point_Hanako+=3;
					    break;
					}

					if(j==len_Taro-1 && len_Taro<len_Hanako){
						point_Hanako+=3;
						break;
					}else if(j==len_Hanako-1 && len_Taro>len_Hanako){
						point_Taro+=3;
						break;
					}else if(j==len_Taro-1&&len_Taro==len_Hanako){
					point_Hanako++;
					point_Taro++;
					break;}
				}



			}//num?????°???????????? {
				str=reader.readLine();
				str_array=str.split(" ");
				charstr_Taro=str_array[0].toCharArray();
				charstr_Hanako=str_array[1].toCharArray();

				len_Taro=charstr_Taro.length;
				len_Hanako=charstr_Hanako.length;


				for(int j=0;j<len_Taro&&j<len_Hanako;j++){//???????????????????????????????????????
					Taro=charstr_Taro[j];
					Hanako=charstr_Hanako[j];

					if(Taro>Hanako){

						point_Taro+=3;
					    break;
					}else if(Taro<Hanako){

						point_Hanako+=3;
					    break;
					}

					if(j==len_Taro-1 && len_Taro<len_Hanako){
						point_Hanako+=3;
						break;
					}else if(j==len_Hanako-1 && len_Taro>len_Hanako){
						point_Taro+=3;
						break;
					}else if(j==len_Taro-1&&len_Taro==len_Hanako){
					point_Hanako++;
					point_Taro++;
					break;}
				}



			} str=reader.readLine() str reader.readLine() reader.readLine reader str_array=str.split(" ") str_array str.split(" ") str.split str " " charstr_Taro=str_array[0].toCharArray() charstr_Taro str_array[0].toCharArray() str_array[0].toCharArray str_array[0] str_array 0 charstr_Hanako=str_array[1].toCharArray() charstr_Hanako str_array[1].toCharArray() str_array[1].toCharArray str_array[1] str_array 1 len_Taro=charstr_Taro.length len_Taro charstr_Taro.length charstr_Taro charstr_Taro.length len_Hanako=charstr_Hanako.length len_Hanako charstr_Hanako.length charstr_Hanako charstr_Hanako.length for(int j=0;j<len_Taro&&j<len_Hanako;j++){//???????????????????????????????????????
					Taro=charstr_Taro[j];
					Hanako=charstr_Hanako[j];

					if(Taro>Hanako){

						point_Taro+=3;
					    break;
					}else if(Taro<Hanako){

						point_Hanako+=3;
					    break;
					}

					if(j==len_Taro-1 && len_Taro<len_Hanako){
						point_Hanako+=3;
						break;
					}else if(j==len_Hanako-1 && len_Taro>len_Hanako){
						point_Taro+=3;
						break;
					}else if(j==len_Taro-1&&len_Taro==len_Hanako){
					point_Hanako++;
					point_Taro++;
					break;}
				} int j=0; int j=0; j 0 j<len_Taro&&j<len_Hanako j<len_Taro j len_Taro j<len_Hanako j len_Hanako j++ j++ j {//???????????????????????????????????????
					Taro=charstr_Taro[j];
					Hanako=charstr_Hanako[j];

					if(Taro>Hanako){

						point_Taro+=3;
					    break;
					}else if(Taro<Hanako){

						point_Hanako+=3;
					    break;
					}

					if(j==len_Taro-1 && len_Taro<len_Hanako){
						point_Hanako+=3;
						break;
					}else if(j==len_Hanako-1 && len_Taro>len_Hanako){
						point_Taro+=3;
						break;
					}else if(j==len_Taro-1&&len_Taro==len_Hanako){
					point_Hanako++;
					point_Taro++;
					break;}
				} {//???????????????????????????????????????
					Taro=charstr_Taro[j];
					Hanako=charstr_Hanako[j];

					if(Taro>Hanako){

						point_Taro+=3;
					    break;
					}else if(Taro<Hanako){

						point_Hanako+=3;
					    break;
					}

					if(j==len_Taro-1 && len_Taro<len_Hanako){
						point_Hanako+=3;
						break;
					}else if(j==len_Hanako-1 && len_Taro>len_Hanako){
						point_Taro+=3;
						break;
					}else if(j==len_Taro-1&&len_Taro==len_Hanako){
					point_Hanako++;
					point_Taro++;
					break;}
				} Taro=charstr_Taro[j] Taro charstr_Taro[j] charstr_Taro j Hanako=charstr_Hanako[j] Hanako charstr_Hanako[j] charstr_Hanako j if(Taro>Hanako){

						point_Taro+=3;
					    break;
					}else if(Taro<Hanako){

						point_Hanako+=3;
					    break;
					} Taro>Hanako Taro Hanako {

						point_Taro+=3;
					    break;
					} point_Taro+=3 point_Taro 3 break; if(Taro<Hanako){

						point_Hanako+=3;
					    break;
					} Taro<Hanako Taro Hanako {

						point_Hanako+=3;
					    break;
					} point_Hanako+=3 point_Hanako 3 break; if(j==len_Taro-1 && len_Taro<len_Hanako){
						point_Hanako+=3;
						break;
					}else if(j==len_Hanako-1 && len_Taro>len_Hanako){
						point_Taro+=3;
						break;
					}else if(j==len_Taro-1&&len_Taro==len_Hanako){
					point_Hanako++;
					point_Taro++;
					break;} j==len_Taro-1 && len_Taro<len_Hanako j==len_Taro-1 j len_Taro-1 len_Taro 1 len_Taro<len_Hanako len_Taro len_Hanako {
						point_Hanako+=3;
						break;
					} point_Hanako+=3 point_Hanako 3 break; if(j==len_Hanako-1 && len_Taro>len_Hanako){
						point_Taro+=3;
						break;
					}else if(j==len_Taro-1&&len_Taro==len_Hanako){
					point_Hanako++;
					point_Taro++;
					break;} j==len_Hanako-1 && len_Taro>len_Hanako j==len_Hanako-1 j len_Hanako-1 len_Hanako 1 len_Taro>len_Hanako len_Taro len_Hanako {
						point_Taro+=3;
						break;
					} point_Taro+=3 point_Taro 3 break; if(j==len_Taro-1&&len_Taro==len_Hanako){
					point_Hanako++;
					point_Taro++;
					break;} j==len_Taro-1&&len_Taro==len_Hanako j==len_Taro-1 j len_Taro-1 len_Taro 1 len_Taro==len_Hanako len_Taro len_Hanako {
					point_Hanako++;
					point_Taro++;
					break;} point_Hanako++ point_Hanako point_Taro++ point_Taro break; System.out.println(point_Taro+" "+point_Hanako) System.out.println System.out System System.out point_Taro+" "+point_Hanako point_Taro+" "+point_Hanako point_Taro " " point_Hanako String[] args args public class Main{
	public static void main(String[] args){

		BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));
		int num;
		int point_Taro=0;
		int point_Hanako=0;
		int Taro, Hanako;
		char[] charstr_Taro;
		char[] charstr_Hanako;
		String str;
		String[] str_array;
		int len_Taro, len_Hanako;


		try{

			num=Integer.parseInt(reader.readLine());

			for(int i=0;i<num;i++){
				str=reader.readLine();
				str_array=str.split(" ");
				charstr_Taro=str_array[0].toCharArray();
				charstr_Hanako=str_array[1].toCharArray();

				len_Taro=charstr_Taro.length;
				len_Hanako=charstr_Hanako.length;


				for(int j=0;j<len_Taro&&j<len_Hanako;j++){//???????????????????????????????????????
					Taro=charstr_Taro[j];
					Hanako=charstr_Hanako[j];

					if(Taro>Hanako){

						point_Taro+=3;
					    break;
					}else if(Taro<Hanako){

						point_Hanako+=3;
					    break;
					}

					if(j==len_Taro-1 && len_Taro<len_Hanako){
						point_Hanako+=3;
						break;
					}else if(j==len_Hanako-1 && len_Taro>len_Hanako){
						point_Taro+=3;
						break;
					}else if(j==len_Taro-1&&len_Taro==len_Hanako){
					point_Hanako++;
					point_Taro++;
					break;}
				}



			}//num?????°????????????
			System.out.println(point_Taro+" "+point_Hanako);

		}catch(IOException e){
			System.out.print(e);
		}
	}

} public class Main{
	public static void main(String[] args){

		BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));
		int num;
		int point_Taro=0;
		int point_Hanako=0;
		int Taro, Hanako;
		char[] charstr_Taro;
		char[] charstr_Hanako;
		String str;
		String[] str_array;
		int len_Taro, len_Hanako;


		try{

			num=Integer.parseInt(reader.readLine());

			for(int i=0;i<num;i++){
				str=reader.readLine();
				str_array=str.split(" ");
				charstr_Taro=str_array[0].toCharArray();
				charstr_Hanako=str_array[1].toCharArray();

				len_Taro=charstr_Taro.length;
				len_Hanako=charstr_Hanako.length;


				for(int j=0;j<len_Taro&&j<len_Hanako;j++){//???????????????????????????????????????
					Taro=charstr_Taro[j];
					Hanako=charstr_Hanako[j];

					if(Taro>Hanako){

						point_Taro+=3;
					    break;
					}else if(Taro<Hanako){

						point_Hanako+=3;
					    break;
					}

					if(j==len_Taro-1 && len_Taro<len_Hanako){
						point_Hanako+=3;
						break;
					}else if(j==len_Hanako-1 && len_Taro>len_Hanako){
						point_Taro+=3;
						break;
					}else if(j==len_Taro-1&&len_Taro==len_Hanako){
					point_Hanako++;
					point_Taro++;
					break;}
				}



			}//num?????°????????????
			System.out.println(point_Taro+" "+point_Hanako);

		}catch(IOException e){
			System.out.print(e);
		}
	}

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



public class Main{
	public static void main(String[] args){

		BufferedReader reader=new BufferedReader(new InputStreamReader(System.in));
		int num;
		int point_Taro=0;
		int point_Hanako=0;
		int Taro, Hanako;
		char[] charstr_Taro;
		char[] charstr_Hanako;
		String str;
		String[] str_array;
		int len_Taro, len_Hanako;


		try{

			num=Integer.parseInt(reader.readLine());

			for(int i=0;i<num;i++){
				str=reader.readLine();
				str_array=str.split(" ");
				charstr_Taro=str_array[0].toCharArray();
				charstr_Hanako=str_array[1].toCharArray();

				len_Taro=charstr_Taro.length;
				len_Hanako=charstr_Hanako.length;


				for(int j=0;j<len_Taro&&j<len_Hanako;j++){//???????????????????????????????????????
					Taro=charstr_Taro[j];
					Hanako=charstr_Hanako[j];

					if(Taro>Hanako){

						point_Taro+=3;
					    break;
					}else if(Taro<Hanako){

						point_Hanako+=3;
					    break;
					}

					if(j==len_Taro-1 && len_Taro<len_Hanako){
						point_Hanako+=3;
						break;
					}else if(j==len_Hanako-1 && len_Taro>len_Hanako){
						point_Taro+=3;
						break;
					}else if(j==len_Taro-1&&len_Taro==len_Hanako){
					point_Hanako++;
					point_Taro++;
					break;}
				}



			}//num?????°????????????
			System.out.println(point_Taro+" "+point_Hanako);

		}catch(IOException e){
			System.out.print(e);
		}
	}

}