Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner s = new Scanner(System.in);
- int n = s.nextInt();
- char[] a = new char[n];
- int count = 0;
- for (int i = 0; i < n; i++) {
- a[i] = s.next().charAt(0);
- }
- for (int i = 0; i < n; i++) {
- if (a[i] == s.next().charAt(0)) count++;
- }
- System.out.println(count);
- }
- }
Add Comment
Please, Sign In to add comment