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

public class Main {
	 public static void main(String[] age)throws IOException{
		 BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		 StringBuffer sb = new StringBuffer();

		 int n = Integer.parseInt(br.readLine());
		 int i = 0;
		 int j = 0;
		 int a = 0;
		 int T = 0;
		 int H = 0;
		 String alha = "abcdefghijklmnopqrstuvwxyz";

		 while( a<n ){
			 String[] input = br.readLine().split(" ");

			 if( input[0].equals(input[1]) ){
				 T++;
				 H++;
			 }else if( input[0].length()>=input[1].length() ){
				 for( i=0 ; i<input[1].length() ; i++ ){
					 if( input[0].substring(i, i+1).equals(input[1].substring(i, i+1))){
						 if( i==input[1].length()-1 ) T = T+3;
					 }else{
						 for( j=0 ; j<26 ; j++ ){
							 if( input[0].substring(i,i+1).equals(alha.substring(j, j+1)) ){
								 H = H+3;
								 break;
							 }else if( input[1].substring(i,i+1).equals(alha.substring(j,j+1))){
								 T = T+3;
								 break;
							 }
						 }
						 break;
					 }
				 }
			 }else if( input[0].length()<input[1].length() ){
				 for( i=0 ; i<input[0].length() ; i++ ){
					 if( input[0].substring(i, i+1).equals(input[1].substring(i, i+1))){
						 if( i==input[0].length()-1 ) H = H+3;
					 }else{
						 for( j=0 ; j<26 ; j++ ){
							 if( input[0].substring(i,i+1).equals(alha.substring(j, j+1)) ){
								 H = H+3;
								 break;
							 }else if( input[1].substring(i,i+1).equals(alha.substring(j,j+1))){
								 T = T+3;
								 break;
							 }
						 }
						 break;
					 }
				 }
			 }

			 a++;
		 }

		 sb.append(Integer.toString(T)).append(" ").append(Integer.toString(H));
		 System.out.println(sb);
	 }
} 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[] age)throws IOException{
		 BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		 StringBuffer sb = new StringBuffer();

		 int n = Integer.parseInt(br.readLine());
		 int i = 0;
		 int j = 0;
		 int a = 0;
		 int T = 0;
		 int H = 0;
		 String alha = "abcdefghijklmnopqrstuvwxyz";

		 while( a<n ){
			 String[] input = br.readLine().split(" ");

			 if( input[0].equals(input[1]) ){
				 T++;
				 H++;
			 }else if( input[0].length()>=input[1].length() ){
				 for( i=0 ; i<input[1].length() ; i++ ){
					 if( input[0].substring(i, i+1).equals(input[1].substring(i, i+1))){
						 if( i==input[1].length()-1 ) T = T+3;
					 }else{
						 for( j=0 ; j<26 ; j++ ){
							 if( input[0].substring(i,i+1).equals(alha.substring(j, j+1)) ){
								 H = H+3;
								 break;
							 }else if( input[1].substring(i,i+1).equals(alha.substring(j,j+1))){
								 T = T+3;
								 break;
							 }
						 }
						 break;
					 }
				 }
			 }else if( input[0].length()<input[1].length() ){
				 for( i=0 ; i<input[0].length() ; i++ ){
					 if( input[0].substring(i, i+1).equals(input[1].substring(i, i+1))){
						 if( i==input[0].length()-1 ) H = H+3;
					 }else{
						 for( j=0 ; j<26 ; j++ ){
							 if( input[0].substring(i,i+1).equals(alha.substring(j, j+1)) ){
								 H = H+3;
								 break;
							 }else if( input[1].substring(i,i+1).equals(alha.substring(j,j+1))){
								 T = T+3;
								 break;
							 }
						 }
						 break;
					 }
				 }
			 }

			 a++;
		 }

		 sb.append(Integer.toString(T)).append(" ").append(Integer.toString(H));
		 System.out.println(sb);
	 }
} Main public static void main(String[] age)throws IOException{
		 BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		 StringBuffer sb = new StringBuffer();

		 int n = Integer.parseInt(br.readLine());
		 int i = 0;
		 int j = 0;
		 int a = 0;
		 int T = 0;
		 int H = 0;
		 String alha = "abcdefghijklmnopqrstuvwxyz";

		 while( a<n ){
			 String[] input = br.readLine().split(" ");

			 if( input[0].equals(input[1]) ){
				 T++;
				 H++;
			 }else if( input[0].length()>=input[1].length() ){
				 for( i=0 ; i<input[1].length() ; i++ ){
					 if( input[0].substring(i, i+1).equals(input[1].substring(i, i+1))){
						 if( i==input[1].length()-1 ) T = T+3;
					 }else{
						 for( j=0 ; j<26 ; j++ ){
							 if( input[0].substring(i,i+1).equals(alha.substring(j, j+1)) ){
								 H = H+3;
								 break;
							 }else if( input[1].substring(i,i+1).equals(alha.substring(j,j+1))){
								 T = T+3;
								 break;
							 }
						 }
						 break;
					 }
				 }
			 }else if( input[0].length()<input[1].length() ){
				 for( i=0 ; i<input[0].length() ; i++ ){
					 if( input[0].substring(i, i+1).equals(input[1].substring(i, i+1))){
						 if( i==input[0].length()-1 ) H = H+3;
					 }else{
						 for( j=0 ; j<26 ; j++ ){
							 if( input[0].substring(i,i+1).equals(alha.substring(j, j+1)) ){
								 H = H+3;
								 break;
							 }else if( input[1].substring(i,i+1).equals(alha.substring(j,j+1))){
								 T = T+3;
								 break;
							 }
						 }
						 break;
					 }
				 }
			 }

			 a++;
		 }

		 sb.append(Integer.toString(T)).append(" ").append(Integer.toString(H));
		 System.out.println(sb);
	 } main {
		 BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		 StringBuffer sb = new StringBuffer();

		 int n = Integer.parseInt(br.readLine());
		 int i = 0;
		 int j = 0;
		 int a = 0;
		 int T = 0;
		 int H = 0;
		 String alha = "abcdefghijklmnopqrstuvwxyz";

		 while( a<n ){
			 String[] input = br.readLine().split(" ");

			 if( input[0].equals(input[1]) ){
				 T++;
				 H++;
			 }else if( input[0].length()>=input[1].length() ){
				 for( i=0 ; i<input[1].length() ; i++ ){
					 if( input[0].substring(i, i+1).equals(input[1].substring(i, i+1))){
						 if( i==input[1].length()-1 ) T = T+3;
					 }else{
						 for( j=0 ; j<26 ; j++ ){
							 if( input[0].substring(i,i+1).equals(alha.substring(j, j+1)) ){
								 H = H+3;
								 break;
							 }else if( input[1].substring(i,i+1).equals(alha.substring(j,j+1))){
								 T = T+3;
								 break;
							 }
						 }
						 break;
					 }
				 }
			 }else if( input[0].length()<input[1].length() ){
				 for( i=0 ; i<input[0].length() ; i++ ){
					 if( input[0].substring(i, i+1).equals(input[1].substring(i, i+1))){
						 if( i==input[0].length()-1 ) H = H+3;
					 }else{
						 for( j=0 ; j<26 ; j++ ){
							 if( input[0].substring(i,i+1).equals(alha.substring(j, j+1)) ){
								 H = H+3;
								 break;
							 }else if( input[1].substring(i,i+1).equals(alha.substring(j,j+1))){
								 T = T+3;
								 break;
							 }
						 }
						 break;
					 }
				 }
			 }

			 a++;
		 }

		 sb.append(Integer.toString(T)).append(" ").append(Integer.toString(H));
		 System.out.println(sb);
	 } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) StringBuffer sb = new StringBuffer(); sb new StringBuffer() int n = Integer.parseInt(br.readLine()); n Integer.parseInt(br.readLine()) Integer.parseInt Integer br.readLine() br.readLine br int i = 0; i 0 int j = 0; j 0 int a = 0; a 0 int T = 0; T 0 int H = 0; H 0 String alha = "abcdefghijklmnopqrstuvwxyz"; alha "abcdefghijklmnopqrstuvwxyz" while( a<n ){
			 String[] input = br.readLine().split(" ");

			 if( input[0].equals(input[1]) ){
				 T++;
				 H++;
			 }else if( input[0].length()>=input[1].length() ){
				 for( i=0 ; i<input[1].length() ; i++ ){
					 if( input[0].substring(i, i+1).equals(input[1].substring(i, i+1))){
						 if( i==input[1].length()-1 ) T = T+3;
					 }else{
						 for( j=0 ; j<26 ; j++ ){
							 if( input[0].substring(i,i+1).equals(alha.substring(j, j+1)) ){
								 H = H+3;
								 break;
							 }else if( input[1].substring(i,i+1).equals(alha.substring(j,j+1))){
								 T = T+3;
								 break;
							 }
						 }
						 break;
					 }
				 }
			 }else if( input[0].length()<input[1].length() ){
				 for( i=0 ; i<input[0].length() ; i++ ){
					 if( input[0].substring(i, i+1).equals(input[1].substring(i, i+1))){
						 if( i==input[0].length()-1 ) H = H+3;
					 }else{
						 for( j=0 ; j<26 ; j++ ){
							 if( input[0].substring(i,i+1).equals(alha.substring(j, j+1)) ){
								 H = H+3;
								 break;
							 }else if( input[1].substring(i,i+1).equals(alha.substring(j,j+1))){
								 T = T+3;
								 break;
							 }
						 }
						 break;
					 }
				 }
			 }

			 a++;
		 } a<n a n {
			 String[] input = br.readLine().split(" ");

			 if( input[0].equals(input[1]) ){
				 T++;
				 H++;
			 }else if( input[0].length()>=input[1].length() ){
				 for( i=0 ; i<input[1].length() ; i++ ){
					 if( input[0].substring(i, i+1).equals(input[1].substring(i, i+1))){
						 if( i==input[1].length()-1 ) T = T+3;
					 }else{
						 for( j=0 ; j<26 ; j++ ){
							 if( input[0].substring(i,i+1).equals(alha.substring(j, j+1)) ){
								 H = H+3;
								 break;
							 }else if( input[1].substring(i,i+1).equals(alha.substring(j,j+1))){
								 T = T+3;
								 break;
							 }
						 }
						 break;
					 }
				 }
			 }else if( input[0].length()<input[1].length() ){
				 for( i=0 ; i<input[0].length() ; i++ ){
					 if( input[0].substring(i, i+1).equals(input[1].substring(i, i+1))){
						 if( i==input[0].length()-1 ) H = H+3;
					 }else{
						 for( j=0 ; j<26 ; j++ ){
							 if( input[0].substring(i,i+1).equals(alha.substring(j, j+1)) ){
								 H = H+3;
								 break;
							 }else if( input[1].substring(i,i+1).equals(alha.substring(j,j+1))){
								 T = T+3;
								 break;
							 }
						 }
						 break;
					 }
				 }
			 }

			 a++;
		 } String[] input = br.readLine().split(" "); input br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " if( input[0].equals(input[1]) ){
				 T++;
				 H++;
			 }else if( input[0].length()>=input[1].length() ){
				 for( i=0 ; i<input[1].length() ; i++ ){
					 if( input[0].substring(i, i+1).equals(input[1].substring(i, i+1))){
						 if( i==input[1].length()-1 ) T = T+3;
					 }else{
						 for( j=0 ; j<26 ; j++ ){
							 if( input[0].substring(i,i+1).equals(alha.substring(j, j+1)) ){
								 H = H+3;
								 break;
							 }else if( input[1].substring(i,i+1).equals(alha.substring(j,j+1))){
								 T = T+3;
								 break;
							 }
						 }
						 break;
					 }
				 }
			 }else if( input[0].length()<input[1].length() ){
				 for( i=0 ; i<input[0].length() ; i++ ){
					 if( input[0].substring(i, i+1).equals(input[1].substring(i, i+1))){
						 if( i==input[0].length()-1 ) H = H+3;
					 }else{
						 for( j=0 ; j<26 ; j++ ){
							 if( input[0].substring(i,i+1).equals(alha.substring(j, j+1)) ){
								 H = H+3;
								 break;
							 }else if( input[1].substring(i,i+1).equals(alha.substring(j,j+1))){
								 T = T+3;
								 break;
							 }
						 }
						 break;
					 }
				 }
			 } input[0].equals(input[1]) input[0].equals input[0] input 0 input[1] input 1 {
				 T++;
				 H++;
			 } T++ T H++ H if( input[0].length()>=input[1].length() ){
				 for( i=0 ; i<input[1].length() ; i++ ){
					 if( input[0].substring(i, i+1).equals(input[1].substring(i, i+1))){
						 if( i==input[1].length()-1 ) T = T+3;
					 }else{
						 for( j=0 ; j<26 ; j++ ){
							 if( input[0].substring(i,i+1).equals(alha.substring(j, j+1)) ){
								 H = H+3;
								 break;
							 }else if( input[1].substring(i,i+1).equals(alha.substring(j,j+1))){
								 T = T+3;
								 break;
							 }
						 }
						 break;
					 }
				 }
			 }else if( input[0].length()<input[1].length() ){
				 for( i=0 ; i<input[0].length() ; i++ ){
					 if( input[0].substring(i, i+1).equals(input[1].substring(i, i+1))){
						 if( i==input[0].length()-1 ) H = H+3;
					 }else{
						 for( j=0 ; j<26 ; j++ ){
							 if( input[0].substring(i,i+1).equals(alha.substring(j, j+1)) ){
								 H = H+3;
								 break;
							 }else if( input[1].substring(i,i+1).equals(alha.substring(j,j+1))){
								 T = T+3;
								 break;
							 }
						 }
						 break;
					 }
				 }
			 } input[0].length()>=input[1].length() input[0].length() input[0].length input[0] input 0 input[1].length() input[1].length input[1] input 1 {
				 for( i=0 ; i<input[1].length() ; i++ ){
					 if( input[0].substring(i, i+1).equals(input[1].substring(i, i+1))){
						 if( i==input[1].length()-1 ) T = T+3;
					 }else{
						 for( j=0 ; j<26 ; j++ ){
							 if( input[0].substring(i,i+1).equals(alha.substring(j, j+1)) ){
								 H = H+3;
								 break;
							 }else if( input[1].substring(i,i+1).equals(alha.substring(j,j+1))){
								 T = T+3;
								 break;
							 }
						 }
						 break;
					 }
				 }
			 } for( i=0 ; i<input[1].length() ; i++ ){
					 if( input[0].substring(i, i+1).equals(input[1].substring(i, i+1))){
						 if( i==input[1].length()-1 ) T = T+3;
					 }else{
						 for( j=0 ; j<26 ; j++ ){
							 if( input[0].substring(i,i+1).equals(alha.substring(j, j+1)) ){
								 H = H+3;
								 break;
							 }else if( input[1].substring(i,i+1).equals(alha.substring(j,j+1))){
								 T = T+3;
								 break;
							 }
						 }
						 break;
					 }
				 } i=0 ; i=0 i 0 i<input[1].length() i input[1].length() input[1].length input[1] input 1 i++ i++ i {
					 if( input[0].substring(i, i+1).equals(input[1].substring(i, i+1))){
						 if( i==input[1].length()-1 ) T = T+3;
					 }else{
						 for( j=0 ; j<26 ; j++ ){
							 if( input[0].substring(i,i+1).equals(alha.substring(j, j+1)) ){
								 H = H+3;
								 break;
							 }else if( input[1].substring(i,i+1).equals(alha.substring(j,j+1))){
								 T = T+3;
								 break;
							 }
						 }
						 break;
					 }
				 } {
					 if( input[0].substring(i, i+1).equals(input[1].substring(i, i+1))){
						 if( i==input[1].length()-1 ) T = T+3;
					 }else{
						 for( j=0 ; j<26 ; j++ ){
							 if( input[0].substring(i,i+1).equals(alha.substring(j, j+1)) ){
								 H = H+3;
								 break;
							 }else if( input[1].substring(i,i+1).equals(alha.substring(j,j+1))){
								 T = T+3;
								 break;
							 }
						 }
						 break;
					 }
				 } if( input[0].substring(i, i+1).equals(input[1].substring(i, i+1))){
						 if( i==input[1].length()-1 ) T = T+3;
					 }else{
						 for( j=0 ; j<26 ; j++ ){
							 if( input[0].substring(i,i+1).equals(alha.substring(j, j+1)) ){
								 H = H+3;
								 break;
							 }else if( input[1].substring(i,i+1).equals(alha.substring(j,j+1))){
								 T = T+3;
								 break;
							 }
						 }
						 break;
					 } input[0].substring(i, i+1).equals(input[1].substring(i, i+1)) input[0].substring(i, i+1).equals input[0].substring(i, i+1) input[0].substring input[0] input 0 i i+1 i 1 input[1].substring(i, i+1) input[1].substring input[1] input 1 i i+1 i 1 {
						 if( i==input[1].length()-1 ) T = T+3;
					 } if( i==input[1].length()-1 ) T = T+3; i==input[1].length()-1 i input[1].length()-1 input[1].length() input[1].length input[1] input 1 1 T = T+3 T T+3 T 3 {
						 for( j=0 ; j<26 ; j++ ){
							 if( input[0].substring(i,i+1).equals(alha.substring(j, j+1)) ){
								 H = H+3;
								 break;
							 }else if( input[1].substring(i,i+1).equals(alha.substring(j,j+1))){
								 T = T+3;
								 break;
							 }
						 }
						 break;
					 } for( j=0 ; j<26 ; j++ ){
							 if( input[0].substring(i,i+1).equals(alha.substring(j, j+1)) ){
								 H = H+3;
								 break;
							 }else if( input[1].substring(i,i+1).equals(alha.substring(j,j+1))){
								 T = T+3;
								 break;
							 }
						 } j=0 ; j=0 j 0 j<26 j 26 j++ j++ j {
							 if( input[0].substring(i,i+1).equals(alha.substring(j, j+1)) ){
								 H = H+3;
								 break;
							 }else if( input[1].substring(i,i+1).equals(alha.substring(j,j+1))){
								 T = T+3;
								 break;
							 }
						 } {
							 if( input[0].substring(i,i+1).equals(alha.substring(j, j+1)) ){
								 H = H+3;
								 break;
							 }else if( input[1].substring(i,i+1).equals(alha.substring(j,j+1))){
								 T = T+3;
								 break;
							 }
						 } if( input[0].substring(i,i+1).equals(alha.substring(j, j+1)) ){
								 H = H+3;
								 break;
							 }else if( input[1].substring(i,i+1).equals(alha.substring(j,j+1))){
								 T = T+3;
								 break;
							 } input[0].substring(i,i+1).equals(alha.substring(j, j+1)) input[0].substring(i,i+1).equals input[0].substring(i,i+1) input[0].substring input[0] input 0 i i+1 i 1 alha.substring(j, j+1) alha.substring alha j j+1 j 1 {
								 H = H+3;
								 break;
							 } H = H+3 H H+3 H 3 break; if( input[1].substring(i,i+1).equals(alha.substring(j,j+1))){
								 T = T+3;
								 break;
							 } input[1].substring(i,i+1).equals(alha.substring(j,j+1)) input[1].substring(i,i+1).equals input[1].substring(i,i+1) input[1].substring input[1] input 1 i i+1 i 1 alha.substring(j,j+1) alha.substring alha j j+1 j 1 {
								 T = T+3;
								 break;
							 } T = T+3 T T+3 T 3 break; break; if( input[0].length()<input[1].length() ){
				 for( i=0 ; i<input[0].length() ; i++ ){
					 if( input[0].substring(i, i+1).equals(input[1].substring(i, i+1))){
						 if( i==input[0].length()-1 ) H = H+3;
					 }else{
						 for( j=0 ; j<26 ; j++ ){
							 if( input[0].substring(i,i+1).equals(alha.substring(j, j+1)) ){
								 H = H+3;
								 break;
							 }else if( input[1].substring(i,i+1).equals(alha.substring(j,j+1))){
								 T = T+3;
								 break;
							 }
						 }
						 break;
					 }
				 }
			 } input[0].length()<input[1].length() input[0].length() input[0].length input[0] input 0 input[1].length() input[1].length input[1] input 1 {
				 for( i=0 ; i<input[0].length() ; i++ ){
					 if( input[0].substring(i, i+1).equals(input[1].substring(i, i+1))){
						 if( i==input[0].length()-1 ) H = H+3;
					 }else{
						 for( j=0 ; j<26 ; j++ ){
							 if( input[0].substring(i,i+1).equals(alha.substring(j, j+1)) ){
								 H = H+3;
								 break;
							 }else if( input[1].substring(i,i+1).equals(alha.substring(j,j+1))){
								 T = T+3;
								 break;
							 }
						 }
						 break;
					 }
				 }
			 } for( i=0 ; i<input[0].length() ; i++ ){
					 if( input[0].substring(i, i+1).equals(input[1].substring(i, i+1))){
						 if( i==input[0].length()-1 ) H = H+3;
					 }else{
						 for( j=0 ; j<26 ; j++ ){
							 if( input[0].substring(i,i+1).equals(alha.substring(j, j+1)) ){
								 H = H+3;
								 break;
							 }else if( input[1].substring(i,i+1).equals(alha.substring(j,j+1))){
								 T = T+3;
								 break;
							 }
						 }
						 break;
					 }
				 } i=0 ; i=0 i 0 i<input[0].length() i input[0].length() input[0].length input[0] input 0 i++ i++ i {
					 if( input[0].substring(i, i+1).equals(input[1].substring(i, i+1))){
						 if( i==input[0].length()-1 ) H = H+3;
					 }else{
						 for( j=0 ; j<26 ; j++ ){
							 if( input[0].substring(i,i+1).equals(alha.substring(j, j+1)) ){
								 H = H+3;
								 break;
							 }else if( input[1].substring(i,i+1).equals(alha.substring(j,j+1))){
								 T = T+3;
								 break;
							 }
						 }
						 break;
					 }
				 } {
					 if( input[0].substring(i, i+1).equals(input[1].substring(i, i+1))){
						 if( i==input[0].length()-1 ) H = H+3;
					 }else{
						 for( j=0 ; j<26 ; j++ ){
							 if( input[0].substring(i,i+1).equals(alha.substring(j, j+1)) ){
								 H = H+3;
								 break;
							 }else if( input[1].substring(i,i+1).equals(alha.substring(j,j+1))){
								 T = T+3;
								 break;
							 }
						 }
						 break;
					 }
				 } if( input[0].substring(i, i+1).equals(input[1].substring(i, i+1))){
						 if( i==input[0].length()-1 ) H = H+3;
					 }else{
						 for( j=0 ; j<26 ; j++ ){
							 if( input[0].substring(i,i+1).equals(alha.substring(j, j+1)) ){
								 H = H+3;
								 break;
							 }else if( input[1].substring(i,i+1).equals(alha.substring(j,j+1))){
								 T = T+3;
								 break;
							 }
						 }
						 break;
					 } input[0].substring(i, i+1).equals(input[1].substring(i, i+1)) input[0].substring(i, i+1).equals input[0].substring(i, i+1) input[0].substring input[0] input 0 i i+1 i 1 input[1].substring(i, i+1) input[1].substring input[1] input 1 i i+1 i 1 {
						 if( i==input[0].length()-1 ) H = H+3;
					 } if( i==input[0].length()-1 ) H = H+3; i==input[0].length()-1 i input[0].length()-1 input[0].length() input[0].length input[0] input 0 1 H = H+3 H H+3 H 3 {
						 for( j=0 ; j<26 ; j++ ){
							 if( input[0].substring(i,i+1).equals(alha.substring(j, j+1)) ){
								 H = H+3;
								 break;
							 }else if( input[1].substring(i,i+1).equals(alha.substring(j,j+1))){
								 T = T+3;
								 break;
							 }
						 }
						 break;
					 } for( j=0 ; j<26 ; j++ ){
							 if( input[0].substring(i,i+1).equals(alha.substring(j, j+1)) ){
								 H = H+3;
								 break;
							 }else if( input[1].substring(i,i+1).equals(alha.substring(j,j+1))){
								 T = T+3;
								 break;
							 }
						 } j=0 ; j=0 j 0 j<26 j 26 j++ j++ j {
							 if( input[0].substring(i,i+1).equals(alha.substring(j, j+1)) ){
								 H = H+3;
								 break;
							 }else if( input[1].substring(i,i+1).equals(alha.substring(j,j+1))){
								 T = T+3;
								 break;
							 }
						 } {
							 if( input[0].substring(i,i+1).equals(alha.substring(j, j+1)) ){
								 H = H+3;
								 break;
							 }else if( input[1].substring(i,i+1).equals(alha.substring(j,j+1))){
								 T = T+3;
								 break;
							 }
						 } if( input[0].substring(i,i+1).equals(alha.substring(j, j+1)) ){
								 H = H+3;
								 break;
							 }else if( input[1].substring(i,i+1).equals(alha.substring(j,j+1))){
								 T = T+3;
								 break;
							 } input[0].substring(i,i+1).equals(alha.substring(j, j+1)) input[0].substring(i,i+1).equals input[0].substring(i,i+1) input[0].substring input[0] input 0 i i+1 i 1 alha.substring(j, j+1) alha.substring alha j j+1 j 1 {
								 H = H+3;
								 break;
							 } H = H+3 H H+3 H 3 break; if( input[1].substring(i,i+1).equals(alha.substring(j,j+1))){
								 T = T+3;
								 break;
							 } input[1].substring(i,i+1).equals(alha.substring(j,j+1)) input[1].substring(i,i+1).equals input[1].substring(i,i+1) input[1].substring input[1] input 1 i i+1 i 1 alha.substring(j,j+1) alha.substring alha j j+1 j 1 {
								 T = T+3;
								 break;
							 } T = T+3 T T+3 T 3 break; break; a++ a sb.append(Integer.toString(T)).append(" ").append(Integer.toString(H)) sb.append(Integer.toString(T)).append(" ").append sb.append(Integer.toString(T)).append(" ") sb.append(Integer.toString(T)).append sb.append(Integer.toString(T)) sb.append sb Integer.toString(T) Integer.toString Integer T " " Integer.toString(H) Integer.toString Integer H System.out.println(sb) System.out.println System.out System System.out sb String[] age age public class Main {
	 public static void main(String[] age)throws IOException{
		 BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		 StringBuffer sb = new StringBuffer();

		 int n = Integer.parseInt(br.readLine());
		 int i = 0;
		 int j = 0;
		 int a = 0;
		 int T = 0;
		 int H = 0;
		 String alha = "abcdefghijklmnopqrstuvwxyz";

		 while( a<n ){
			 String[] input = br.readLine().split(" ");

			 if( input[0].equals(input[1]) ){
				 T++;
				 H++;
			 }else if( input[0].length()>=input[1].length() ){
				 for( i=0 ; i<input[1].length() ; i++ ){
					 if( input[0].substring(i, i+1).equals(input[1].substring(i, i+1))){
						 if( i==input[1].length()-1 ) T = T+3;
					 }else{
						 for( j=0 ; j<26 ; j++ ){
							 if( input[0].substring(i,i+1).equals(alha.substring(j, j+1)) ){
								 H = H+3;
								 break;
							 }else if( input[1].substring(i,i+1).equals(alha.substring(j,j+1))){
								 T = T+3;
								 break;
							 }
						 }
						 break;
					 }
				 }
			 }else if( input[0].length()<input[1].length() ){
				 for( i=0 ; i<input[0].length() ; i++ ){
					 if( input[0].substring(i, i+1).equals(input[1].substring(i, i+1))){
						 if( i==input[0].length()-1 ) H = H+3;
					 }else{
						 for( j=0 ; j<26 ; j++ ){
							 if( input[0].substring(i,i+1).equals(alha.substring(j, j+1)) ){
								 H = H+3;
								 break;
							 }else if( input[1].substring(i,i+1).equals(alha.substring(j,j+1))){
								 T = T+3;
								 break;
							 }
						 }
						 break;
					 }
				 }
			 }

			 a++;
		 }

		 sb.append(Integer.toString(T)).append(" ").append(Integer.toString(H));
		 System.out.println(sb);
	 }
} public class Main {
	 public static void main(String[] age)throws IOException{
		 BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		 StringBuffer sb = new StringBuffer();

		 int n = Integer.parseInt(br.readLine());
		 int i = 0;
		 int j = 0;
		 int a = 0;
		 int T = 0;
		 int H = 0;
		 String alha = "abcdefghijklmnopqrstuvwxyz";

		 while( a<n ){
			 String[] input = br.readLine().split(" ");

			 if( input[0].equals(input[1]) ){
				 T++;
				 H++;
			 }else if( input[0].length()>=input[1].length() ){
				 for( i=0 ; i<input[1].length() ; i++ ){
					 if( input[0].substring(i, i+1).equals(input[1].substring(i, i+1))){
						 if( i==input[1].length()-1 ) T = T+3;
					 }else{
						 for( j=0 ; j<26 ; j++ ){
							 if( input[0].substring(i,i+1).equals(alha.substring(j, j+1)) ){
								 H = H+3;
								 break;
							 }else if( input[1].substring(i,i+1).equals(alha.substring(j,j+1))){
								 T = T+3;
								 break;
							 }
						 }
						 break;
					 }
				 }
			 }else if( input[0].length()<input[1].length() ){
				 for( i=0 ; i<input[0].length() ; i++ ){
					 if( input[0].substring(i, i+1).equals(input[1].substring(i, i+1))){
						 if( i==input[0].length()-1 ) H = H+3;
					 }else{
						 for( j=0 ; j<26 ; j++ ){
							 if( input[0].substring(i,i+1).equals(alha.substring(j, j+1)) ){
								 H = H+3;
								 break;
							 }else if( input[1].substring(i,i+1).equals(alha.substring(j,j+1))){
								 T = T+3;
								 break;
							 }
						 }
						 break;
					 }
				 }
			 }

			 a++;
		 }

		 sb.append(Integer.toString(T)).append(" ").append(Integer.toString(H));
		 System.out.println(sb);
	 }
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	 public static void main(String[] age)throws IOException{
		 BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		 StringBuffer sb = new StringBuffer();

		 int n = Integer.parseInt(br.readLine());
		 int i = 0;
		 int j = 0;
		 int a = 0;
		 int T = 0;
		 int H = 0;
		 String alha = "abcdefghijklmnopqrstuvwxyz";

		 while( a<n ){
			 String[] input = br.readLine().split(" ");

			 if( input[0].equals(input[1]) ){
				 T++;
				 H++;
			 }else if( input[0].length()>=input[1].length() ){
				 for( i=0 ; i<input[1].length() ; i++ ){
					 if( input[0].substring(i, i+1).equals(input[1].substring(i, i+1))){
						 if( i==input[1].length()-1 ) T = T+3;
					 }else{
						 for( j=0 ; j<26 ; j++ ){
							 if( input[0].substring(i,i+1).equals(alha.substring(j, j+1)) ){
								 H = H+3;
								 break;
							 }else if( input[1].substring(i,i+1).equals(alha.substring(j,j+1))){
								 T = T+3;
								 break;
							 }
						 }
						 break;
					 }
				 }
			 }else if( input[0].length()<input[1].length() ){
				 for( i=0 ; i<input[0].length() ; i++ ){
					 if( input[0].substring(i, i+1).equals(input[1].substring(i, i+1))){
						 if( i==input[0].length()-1 ) H = H+3;
					 }else{
						 for( j=0 ; j<26 ; j++ ){
							 if( input[0].substring(i,i+1).equals(alha.substring(j, j+1)) ){
								 H = H+3;
								 break;
							 }else if( input[1].substring(i,i+1).equals(alha.substring(j,j+1))){
								 T = T+3;
								 break;
							 }
						 }
						 break;
					 }
				 }
			 }

			 a++;
		 }

		 sb.append(Integer.toString(T)).append(" ").append(Integer.toString(H));
		 System.out.println(sb);
	 }
}