#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 2e5 + 10;
const int MAX_K = 2e5 + 10;
int n, m, k;
int c[MAX_N];
int used[MAX_N];
int ans;
vector<int> v[MAX_N];
int cnt[MAX_K];
vector<int> crr;
void dfs(int x) {
  int i, sz = v[x].size();
  crr.push_back(x);
  used[x] = 1;
  cnt[c[x]]++;
  for (i = 0; i < sz; i++)
    if (!used[v[x][i]]) dfs(v[x][i]);
}
int main() {
  int i, p, q;
  scanf("%d%d%d", &n, &m, &k);
  for (i = 1; i <= n; i++) scanf("%d", &c[i]);
  for (i = 0; i < m; i++) {
    scanf("%d%d", &p, &q);
    v[p].push_back(q);
    v[q].push_back(p);
  }
  for (i = 1; i <= n; i++) {
    if (used[i]) continue;
    crr.clear();
    dfs(i);
    int ma = 0, j;
    for (j = 0; j < (int)crr.size(); j++) {
      ma = max(ma, cnt[c[crr[j]]]);
      cnt[c[crr[j]]] = 0;
    }
    ans += (int)crr.size() - ma;
  }
  printf("%d\n", ans);
  return 0;
}
