#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
const int INF = 1e9;
const long long mod = 1e9 + 7;
int n, m, k;
bool visited[N];
int arr[N];
vector<int> vec;
vector<int> v[N];
void dfs(int x) {
  vec.push_back(arr[x]);
  for (auto isi : v[x]) {
    if (visited[isi]) continue;
    visited[isi] = true;
    dfs(isi);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> m >> k;
  for (int i = 1; i <= n; i++) {
    cin >> arr[i];
  }
  for (int i = 1; i <= m; i++) {
    int s, t;
    cin >> s >> t;
    v[s].push_back(t);
    v[t].push_back(s);
  }
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    if (visited[i]) continue;
    visited[i] = true;
    vec.clear();
    dfs(i);
    sort(vec.begin(), vec.end());
    int cnt = 0, PREV = 0, maxi = 0;
    for (auto isi : vec) {
      if (isi != PREV) {
        cnt = 1;
      } else
        cnt++;
      maxi = max(maxi, cnt);
      PREV = isi;
    }
    ans += ((int)vec.size() - maxi);
  }
  cout << ans << endl;
}
