Guest User

Untitled

a guest
Feb 11th, 2019
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.40 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4.   public static void main(String[] args) {
  5.     Scanner s = new Scanner(System.in);
  6.     int n = s.nextInt();
  7.     char[] a = new char[n];
  8.     int count = 0;
  9.     for (int i = 0; i < n; i++) {
  10.       a[i] = s.next().charAt(0);
  11.     }
  12.     for (int i = 0; i < n; i++) {
  13.       if (a[i] == s.next().charAt(0)) count++;
  14.     }
  15.     System.out.println(count);
  16.   }
  17. }
Add Comment
Please, Sign In to add comment