#include <bits/stdc++.h>
using namespace std;
const int MAXN = 200002;
double eps = 1e-9;
int T, N, M, K, mx, sum, ans;
int a, b, c;
bool visit[MAXN], call[MAXN];
int color[MAXN];
vector<int> v[MAXN];
map<int, int> mp;
void dfs(int n) {
  mp[color[n]]++;
  for (auto i : v[n])
    if (!visit[i]) {
      visit[i] = 1;
      dfs(i);
    }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> N >> M >> K;
  for (int i = 0; i < N; i++) cin >> color[i];
  for (int i = 0; i < M; i++) {
    cin >> a >> b;
    --a, --b;
    call[a] = call[b] = 1;
    v[a].push_back(b);
    v[b].push_back(a);
  }
  for (int i = 0; i < N; i++)
    if (call[i] && !visit[i]) {
      visit[i] = 1;
      mp.clear();
      dfs(i);
      mx = 0;
      sum = 0;
      for (auto i : mp) {
        mx = max(mx, i.second);
        sum += i.second;
      }
      ans += (sum - mx);
    }
  cout << ans << endl;
}
