#include <bits/stdc++.h>
using namespace std;
int col[200001];
int addr[200001];
int amount_of_colors[200001];
struct Node {
  int val;
  int next;
} nodes[200001];
struct Tree {
  int used;
  int first;
  int last;
} vTr[100001];
int main() {
  int n, m, k;
  cin >> n >> m >> k;
  for (int i = 1; i <= n; i++) {
    int x;
    scanf("%d", &x);
    col[i] = x;
  }
  int cur = 0, nTr = 0;
  for (int i = 0; i < m; i++) {
    int a, b;
    scanf("%d %d", &a, &b);
    if (addr[a] == 0) {
      if (addr[b] == 0) {
        nodes[++cur].val = a;
        nodes[cur].next = cur + 1;
        nodes[++cur].val = b;
        vTr[++nTr].used = 1;
        vTr[nTr].first = cur - 1;
        vTr[nTr].last = cur;
        addr[a] = nTr;
        addr[b] = nTr;
      } else {
        nodes[++cur].val = a;
        nodes[vTr[addr[b]].last].next = cur;
        vTr[addr[b]].last = cur;
        addr[a] = addr[b];
      }
    } else {
      if (addr[b] == 0) {
        nodes[++cur].val = b;
        nodes[vTr[addr[a]].last].next = cur;
        vTr[addr[a]].last = cur;
        addr[b] = addr[a];
      } else {
        if (addr[a] != addr[b]) {
          vTr[addr[b]].used = 0;
          nodes[vTr[addr[a]].last].next = vTr[addr[b]].first;
          vTr[addr[a]].last = vTr[addr[b]].last;
          for (int j = vTr[addr[b]].first; j; j = nodes[j].next) {
            addr[nodes[j].val] = addr[a];
          }
        }
      }
    }
  }
  int res = 0;
  for (int i = 1; i <= nTr; i++) {
    if (vTr[i].used == 1) {
      int max_amount = 0, sum = 0;
      for (int j = vTr[i].first; j; j = nodes[j].next) {
        amount_of_colors[col[nodes[j].val]]++;
        if (amount_of_colors[col[nodes[j].val]] > max_amount)
          max_amount = amount_of_colors[col[nodes[j].val]];
        sum++;
      }
      for (int j = vTr[i].first; j; j = nodes[j].next)
        amount_of_colors[col[nodes[j].val]] = 0;
      res += sum - max_amount;
    }
  }
  cout << res << '\n';
  return 0;
}
