#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 7;
int fa[N], sz[N];
int a[N];
vector<int> v[N];
int find(int x) {
  if (fa[x] == x)
    return x;
  else
    return fa[x] = find(fa[x]);
}
int main() {
  int n, m, k;
  scanf("%d%d%d", &n, &m, &k);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  for (int i = 1; i <= n; i++) {
    fa[i] = i;
    sz[i] = 1;
  }
  while (m--) {
    int l, r;
    scanf("%d%d", &l, &r);
    int fl = find(l);
    int fr = find(r);
    if (fl == fr)
      continue;
    else {
      fa[fl] = fr;
      sz[fr] += sz[fl];
    }
  }
  for (int i = 1; i <= n; i++) {
    v[find(i)].push_back(a[i]);
  }
  int ans = 0;
  map<int, int> mp;
  for (int i = 1; i <= n; i++) {
    if (v[i].size() == 0) continue;
    mp.clear();
    for (auto &x : v[i]) {
      mp[x]++;
    }
    int ma = 0;
    for (auto &pear : mp) {
      ma = max(ma, pear.second);
    }
    ans += sz[i] - ma;
  }
  printf("%d\n", ans);
  return 0;
}
