2886 {
2887 int n;
2888 int m;
2889 cin >> n >> m;
2890 char ch;
2891 auto *dot = new int[m];
2892 memset(dot, 0, m * sizeof(int));
2893 auto *normal = new int[m];
2894 memset(normal, 0, m * sizeof(int));
2895 for(int i = 0; i < n; i++) {
2896 for(int j = 0; j < m; j++) {
2897 cin >> ch;
2898 dot[j] |= 1 << ch - 'A';
2899 }
2900 }
2901 for(int i = 0; i < n; i++) {
2902 for(int j = 0; j < m; j++) {
2903 cin >> ch;
2904 normal[j] |= 1 << ch - 'A';
2905 }
2906 }
2907 int count = 0;
2908 for(int i = 0; i < m; i++) {
2909 if((dot[i] & normal[i]) == 0) {
2910 count++;
2911 }
2912 }
2913 cout << count;
2914 delete[] normal;
2915 delete[] dot;
2916 return 0;
2917 }