#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007LL, INF = 1e9, LINF = 1e18;
const long double PI = 3.141592653589793116, EPS = 1e-9,
                  GOLD = ((1 + sqrt(5)) / 2);
template <class T>
int getbit(T s, int i) {
  return (s >> 1) & 1;
}
template <class T>
T onbit(T s, int i) {
  return s | (T(1) << i);
}
template <class T>
T offbit(T s, int i) {
  return s & (~(T(1) << i));
}
template <class T>
int cntbit(T s) {
  return __builtin_popcount(s);
}
long long n, m, k, ans = 0;
vector<long long> c, l, r;
vector<bool> vis;
vector<vector<long long> > adj;
map<long long, long long> Mp;
long long tmp = 0;
void DFS(long long z) {
  vis[z] = true;
  tmp++;
  Mp[c[z]]++;
  for (long long i = 0; i < adj[z].size(); i++) {
    if (!vis[adj[z][i]]) DFS(adj[z][i]);
  }
}
void VarInput() {
  cin >> n >> m >> k;
  c.resize(n);
  l.resize(m);
  r = l;
  for (long long i = 0; i < n; i++) cin >> c[i];
  for (long long i = 0; i < m; i++) cin >> l[i] >> r[i];
}
void ProSolve() {
  vis.resize(n, false);
  adj.resize(n, vector<long long>(0));
  for (long long i = 0; i < m; i++) {
    adj[l[i] - 1].push_back(r[i] - 1);
    adj[r[i] - 1].push_back(l[i] - 1);
  }
  for (long long i = 0; i < n; i++) {
    tmp = 0;
    Mp.clear();
    if (!vis[i]) DFS(i);
    long long mx = 0;
    for (auto it = Mp.begin(); it != Mp.end(); it++) {
      mx = max(mx, it->second);
    }
    ans += (tmp - mx);
  }
  cout << ans;
}
int main() {
  VarInput();
  ProSolve();
  return 0;
}
