#include <bits/stdc++.h>
using namespace std;
void dfs(vector<int> &c, vector<vector<int>> &v, vector<bool> &u,
         map<int, int> &h, int s) {
  u[s] = true;
  h[c[s]]++;
  for (auto t : v[s]) {
    if (u[t]) continue;
    dfs(c, v, u, h, t);
  }
}
int main(int argc, char **argv) {
  cin.tie(NULL);
  int n, m, k;
  cin >> n >> m >> k;
  vector<int> c(n);
  vector<vector<int>> v(n);
  vector<bool> u(n);
  map<int, int> h;
  for (int i = 0; i < n; i++) {
    cin >> c[i];
    c[i]--;
  }
  for (int i = 0; i < m; i++) {
    int l, r;
    cin >> l >> r;
    v[l - 1].push_back(r - 1);
    v[r - 1].push_back(l - 1);
  }
  int total = 0;
  for (int i = 0; i < n; i++) {
    if (u[i]) continue;
    h.clear();
    dfs(c, v, u, h, i);
    int sum = 0, cmax = 0;
    for (auto g : h) {
      cmax = max(cmax, g.second);
      sum += g.second;
    }
    total += sum - cmax;
  }
  cout << total << endl;
  return 0;
}
