import java.io.*;
import java.lang.*;

class StrCmp{
  StrCmp(){
  String str1 = "AMITABH BACHCHAN";
  String str2 = "RAJNIKANTH";
  int count = 0;
  System.out.println(str1.length);
 System.out.println(str2.length);
  }
 public int cmp(){
   for(int i = 0 ; i < str1.length ; i++)
  {
   for(int j = 0 ; j < str2.length ; j++)
   {
    if (str1[i] == str2[j])
     count++;
    else
     continue;
   }
  }
  return count;
  }
}

public class Main{
 public static void main(String[] args){
   StrCmp strcmp = new StrCmp();
   int outp = strcmp.cmp();
   System.out.println(outp);
 }
}