#include <bits/stdc++.h>
using namespace std;
map<int, int> hc;
bool visited[200000];
vector<int> adj[200000];
int degree[200000] = {0};
int color[200000] = {0};
int n_count = 0;
void Utility(int v) {
  n_count++;
  visited[v] = true;
  hc[color[v] - 1]++;
  vector<int>::iterator i;
  for (i = adj[v].begin(); i != adj[v].end(); i++) {
    if (!visited[*i]) Utility(*i);
  }
}
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  for (int i = 0; i < n; i++) cin >> color[i];
  for (int i = 0; i < m; i++) {
    int dum1, dum2;
    cin >> dum1 >> dum2;
    adj[dum1 - 1].push_back(dum2 - 1);
    adj[dum2 - 1].push_back(dum1 - 1);
    degree[dum1 - 1]++;
    degree[dum2 - 1]++;
  }
  memset(visited, false, sizeof(visited));
  int diff = 0;
  for (int i = 0; i < n; i++) {
    if (!visited[i] && degree[i] != 0) {
      hc.clear();
      n_count = 0;
      Utility(i);
      int maxi = 0;
      map<int, int>::iterator it;
      for (it = hc.begin(); it != hc.end(); it++) {
        if ((it->second) > maxi) maxi = it->second;
      }
      diff += (n_count - maxi);
    }
  }
  cout << diff << endl;
}
