#include <bits/stdc++.h>
using namespace std;
int main() {
  string s;
  string s1;
  string s2;
  int a, b;
  cin >> a >> b;
  for (int i = 0; i < a; i++) {
    char c;
    cin >> c;
    c = s[i];
  }
  for (int i = 0; i < b; i++) {
    char d, e;
    cin >> d >> e;
    d = s1[i];
    e = s2[i];
  }
  cout << abs(b - a);
}
