#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
using namespace std;
typedef long long ll;
typedef unsigned long long ul;
typedef unsigned int ui;
const ll mod = 1000000007;
typedef long double ld;
const ll INF = mod * mod;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
#define fr first
#define sc second

#include<cstring>
struct edge {
	int to, id;
};
vector<edge> G[500];
bool vused[500];

bool eused[21001];
int loc[21001];
int par[21001];

vector<vector<int>> vf;
vector<int> es, cop;
bool dfs(int v, int t) {
	if (v == t)return true;
	vused[v] = true;
	rep(i, G[v].size()) {
		edge &e = G[v][i];
		if (vused[e.to])continue;
		if (eused[e.id]&&par[e.id]!=v) {
			if (dfs(e.to, t)) {
				eused[e.id] = false;
				int l = loc[e.id];
				cop.clear();
				bool g = false;
				//cout << l << endl;
				if (l == vf.size())return true;
				rep(j, vf[l].size()) {
					if (vf[l][j] == e.id)g = true;
					else if (g) {
						es.push_back(vf[l][j]);
					}
					else {
						cop.push_back(vf[l][j]);
					}
				}
				vf[l] = es; es = cop;
				rep(j, vf[l].size())loc[vf[l][j]] = l;
				rep(j, es.size())loc[es[j]] = vf.size();
				return true;
			}
		}
		else if(!eused[e.id]){
			if (dfs(e.to, t)) {
				eused[e.id] = true;
				par[e.id] = v;
				es.push_back(e.id);
				loc[e.id] = vf.size();
				return true;
			}
		}
	}
	return false;
}

int max_flow(int s, int t) {
	int flow = 0;
	while (true) {
		es.clear();
		memset(vused, 0, sizeof(vused));
		if (dfs(s, t)) {
			flow++;
			vf.push_back(es);
		}
		else return flow;
	}
}
void solve() {
	int n, m, q; cin >> n >> m >> q;
	int cur = m;
	rep(i, m) {
		int v, u; cin >> v >> u; v--; u--;
		G[v].push_back({ u,i});
		G[u].push_back({ v,i});
	}
	int ans = max_flow(0, n - 1);
	rep(i, q) {
		/*rep(j, vf.size()) {
			rep(k, vf[j].size()) {
				cout << vf[j][k]<<loc[vf[j][k]]<<" ";
			}
			cout << endl;
		}*/
		int x, a, b; cin >> x >> a >> b; a--; b--;
		if (x == 1) {
			G[a].push_back({ b,cur});
			G[b].push_back({ a,cur});
			cur++;
		}
		else {
			rep(j, G[a].size()) {
				edge &e = G[a][j];
				if (e.to == b) {
					if (eused[e.id]) {
						int l = loc[e.id];
						//cout << "?? " << e.id << endl;
						//cout << l << endl;
						rep(k, vf[l].size()) {
							eused[vf[l][k]] = false;
						}
						ans--;
					}
					G[a].erase(G[a].begin() + j);
					break;
				}
			}
			rep(j, G[b].size()) {
				if (G[b][j].to == a) {
					G[b].erase(G[b].begin() + j);
					break;
				}
			}
		}
		ans += max_flow(0, n - 1);
		cout <<ans << endl;
	}
}
int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	solve();
	//stop
	return 0;
}



Measured memory_bytes: 4232