#include <bits/stdc++.h>
using namespace std;
vector<vector<int> > g;
vector<int> q;
bool used[210000];
int c[210000];
int depth;
void dfs(int v) {
  q.push_back(c[v]);
  used[v] = true;
  for (int i = 0; i < g[v].size(); ++i) {
    int to = g[v][i];
    if (!used[to]) {
      dfs(to);
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  int n, m, k;
  cin >> n >> m >> k;
  long long ans = 0;
  for (int i = 1; i <= n; ++i) cin >> c[i];
  g.resize(n + 1);
  for (int i = 1; i <= m; ++i) {
    int l, r;
    cin >> l >> r;
    g[l].push_back(r);
    g[r].push_back(l);
  }
  for (int i = 1; i <= n; ++i) {
    if (!used[i]) {
      q.clear();
      dfs(i);
      sort(q.begin(), q.end());
      int cur = 1;
      int maxx = 1;
      for (int i = 0; i < q.size() - 1; ++i) {
        if (q[i] == q[i + 1])
          cur++;
        else {
          maxx = max(maxx, cur);
          cur = 1;
        }
      }
      maxx = max(maxx, cur);
      ans += q.size() - maxx;
    }
  }
  cout << ans << "\n";
}
