#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using P = pair<int, int>;
const double eps = 1e-8;
const ll MOD = 1000000007;
const int INF = INT_MAX / 2;
const ll LINF = LLONG_MAX / 2;
template<typename T1, typename T2>
bool chmax(T1 &a, const T2 &b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
template<typename T1, typename T2>
bool chmin(T1 &a, const T2 &b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template<typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> p) {
  os << p.first << ":" << p.second;
  return os;
}
template<class T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  for(int i=0;i<((int)(v.size()));++i) {
    if (i) os << " ";
    os << v[i];
  }
  return os;
}
bool dfs(int now, int t, vector<bool> &sel, vector<int> &pr, const vvi &g) {
  if(now == t) return true;
  bool res = false;
  for(int i=0;i<((int)(g.size()));++i) {
    if(g[now][i] == 0) continue;
    if(!sel[i]) {
      sel[i] = true;
      int tmp = pr[i];
      pr[i] = now;
      bool tmp2 = dfs(i, t, sel, pr, g);
      if(tmp2) {
        res = true;
        break;
      }
      pr[i] = tmp;
    }
  }
  return res;
}
bool heiro(int now, int t, vector<bool> &sel, vector<int> &pr, const vvi &g) {
  bool res = false;
  for(int i=0;i<((int)(g.size()));++i) {
    if(g[now][i] == 0) continue;
    if(i == t) {
      pr[i] = now;
      return true;
    } else if(!sel[i]) {
      sel[i] = true;
      int tmp = pr[i];
      pr[i] = now;
      bool tmp2 = heiro(i, t, sel, pr, g);
      if(tmp2) {
        return true;
      }
      pr[i] = tmp;
    }
  }
  return false;
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  int n, e, q;
  cin >> n >> e >> q;
  vvi g(n, vi(n, 0));
  for(int i=0;i<(e);++i) {
    int u, v; cin >> u >> v;
    u--; v--;
    g[u][v]++;
    g[v][u]++;
  }
  int flow = 0;
  while(1) {
    vector<bool> sel(n, false);
    vi pr(n, -1);
    sel[0] = true;
    bool res = dfs(0, n-1, sel, pr, g);
    if(res == 0) break;
    int pos = n-1;
    while(pr[pos] != -1) {
      g[pr[pos]][pos]--;
      g[pos][pr[pos]]++;
      pos = pr[pos];
    }
    flow++;
  }
  for(int _=0;_<(q);++_) {
    int t, u, v; cin >> t >> u >> v;
    u--; v--;
    if(t == 1) {
      g[u][v]++;
      g[v][u]++;
      vector<bool> sel(n, false);
      vi pr(n, -1);
      sel[0] = true;
      bool res = dfs(0, n-1, sel, pr, g);
      if(res) {
        int pos = n-1;
        while(pr[pos] != -1) {
          g[pr[pos]][pos]--;
          g[pos][pr[pos]]++;
          pos = pr[pos];
        }
        flow++;
      }
    } else {
      if(g[u][v] == 1 && g[v][u] == 1) {
        g[u][v] = g[v][u] = 0;
      } else {
        if(g[v][u] == 2) swap(u, v);
        vector<bool> sel(n, false);
        vi pr(n, -1);
        sel[u] = true;
        sel[v] = true;
        pr[v] = u;
        bool res = heiro(v, u, sel, pr, g);
        if(!res) {
          for(int i=0;i<(n);++i) sel[i] = false, pr[i] = -1;
          sel[n-1] = true;
          bool res = dfs(n-1, 0, sel, pr, g);
          assert(res);
          int pos = 0;
          while(pr[pos] != -1) {
            g[pr[pos]][pos]--;
            g[pos][pr[pos]]++;
            pos = pr[pos];
          }
          flow--;
          for(int i=0;i<(n);++i) sel[i] = false, pr[i] = -1;
          sel[u] = true;
          sel[v] = true;
          pr[v] = u;
          heiro(v, u, sel, pr, g);
        }
        int pos = u;
        while(pr[pos] != u) {
          g[pr[pos]][pos]--;
          g[pos][pr[pos]]++;
          pos = pr[pos];
        }
        g[u][v]--;
        g[v][u]++;
        assert(g[u][v] == 1 && g[v][u] == 1);
        g[u][v] = 0;
        g[v][u] = 0;
      }
    }
    cout << flow << endl;
  }
}



Measured memory_bytes: 3936