// Original C++ solution (slower):
#include <cstdio>

#include <cmath>

#include <cstring>

#include <cstdlib>

#include <climits>

#include <ctime>

#include <queue>

#include <stack>

#include <algorithm>

#include <list>

#include <vector>

#include <set>

#include <map>

#include <iostream>

#include <deque>

#include <complex>

#include <string>

#include <iomanip>

#include <sstream>

#include <bitset>

#include <valarray>

#include <iterator>

#include <assert.h>

using namespace std;

typedef long long int ll;

typedef unsigned int uint;

typedef unsigned char uchar;

typedef unsigned long long ull;

typedef pair<int, int> pii;

typedef vector<int> vi;



#define REP(i,x) for(int i=0;i<(int)(x);i++)

#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();i++)

#define RREP(i,x) for(int i=((int)(x)-1);i>=0;i--)

#define RFOR(i,c) for(__typeof((c).rbegin())i=(c).rbegin();i!=(c).rend();i++)

#define ALL(container) container.begin(), container.end()

#define RALL(container) container.rbegin(), container.rend()

#define SZ(container) ((int)container.size())

#define mp(a,b) make_pair(a, b)

#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );



template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }

template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }

template<class T> ostream& operator<<(ostream &os, const vector<T> &t) {

os<<"["; FOR(it,t) {if(it!=t.begin()) os<<","; os<<*it;} os<<"]"; return os;

}

template<class T> ostream& operator<<(ostream &os, const set<T> &t) {

os<<"{"; FOR(it,t) {if(it!=t.begin()) os<<","; os<<*it;} os<<"}"; return os;

}

template<class S, class T> ostream& operator<<(ostream &os, const pair<S,T> &t) { return os<<"("<<t.first<<","<<t.second<<")";}



const double EPS = 1e-8;

const int MOD = 1000000007;







typedef int Weight;

const Weight INF=99999999;

struct Edge{

	int src,dst;

	Weight weight;

	int rev;

	Edge(int f, int t, Weight c,int rev=0):src(f),dst(t),weight(c),rev(rev){}

};

typedef vector< vector<Edge> > Graph;



pii add_edge(Graph &G,int s,int t,Weight cap){

	G[s].push_back(Edge(s,t,cap,G[t].size()));

	G[t].push_back(Edge(t,s,cap,G[s].size()-1));

	return pii(G[s].size()-1, G[t].size()-1);

}





void bfs(const Graph &G,vector<int> &level,int s){

	level[s]=0;

	queue<int> que;

	que.push(s);

	while(!que.empty()){

		int v=que.front();que.pop();

		REP(i,G[v].size()){

			const Edge &e=G[v][i];

			if(e.weight>0 && level[e.dst] < 0){

				level[e.dst] = level[v] +1;

				que.push(e.dst);

			}

		}

	}

}

Weight dfs(Graph &G,vector<int> &level,vector<int> &iter,int v,int t,Weight flow){

	if(v==t)return flow;

	for(int &i=iter[v];i<(int)G[v].size();i++){

		Edge &e=G[v][i];

		if(e.weight>0&&level[v]<level[e.dst]){

			Weight d=dfs(G,level,iter,e.dst,t,min(flow,e.weight));

			if(d>0){

				e.weight-=d;

				G[e.dst][e.rev].weight+=d;

				return d;

			}

		}

	}

return 0;

}



// Dinic

// O(EV^2)

Weight max_flow(Graph &G,int s,int t,int ff=0){

	Weight flow = 0;

	while(true){

		vector<int> level(G.size(),-1);

		vector<int> iter(G.size(),0);

		bfs(G,level,s);

		if(level[t]<0)break; // もう流せない

		if(ff){

			return dfs(G,level,iter,s,t,1);

		}

		Weight f=0;

		while((f=dfs(G,level,iter,s,t,INF))>0){

			flow+=f;

		}

	}

	return flow;

}





int N, E, Q;

int idx[501][501];

main(){

	ios::sync_with_stdio(false);

	cin >> N >> E >> Q;

	memset(idx, -1, sizeof(idx));

	Graph g(N);

	REP(i, E){

		int u, v;

		cin >> u >> v;u--;v--;

		if(idx[u][v] < 0){

			pii res = add_edge(g, u, v, 0);

			idx[u][v] = res.first;

			idx[v][u] = res.second;

		}

		g[u][idx[u][v]].weight ++;

		g[v][idx[v][u]].weight ++;

	}

	int cur = 0;

	REP(i, Q){

		int u, v, f;

		cin >> f >> u >> v;u--;v--;

		if(idx[u][v] < 0){

			pii res = add_edge(g, u, v, 0);

			idx[u][v] = res.first;

			idx[v][u] = res.second;

		}

		if(f == 1){

			g[u][idx[u][v]].weight ++;

			g[v][idx[v][u]].weight ++;

		}else{

			if(g[u][idx[u][v]].weight == 2) swap(u, v);

			if(g[u][idx[u][v]].weight == 0){

				cur -= max_flow(g, N-1, 0, 1);

				if(g[u][idx[u][v]].weight != 1){

					max_flow(g, u, v, 1);

					max_flow(g, v, u, 1);

				}

			}

			g[u][idx[u][v]].weight --;

			g[v][idx[v][u]].weight --;

		}

		cout << (cur += max_flow(g, 0, N-1)) << endl;

	}

	return 0;

}

// Optimized solution to the same problem (faster):
#include <cstdio>

#include <cmath>

#include <cstring>

#include <cstdlib>

#include <climits>

#include <ctime>

#include <queue>

#include <stack>

#include <algorithm>

#include <list>

#include <vector>

#include <set>

#include <map>

#include <iostream>

#include <deque>

#include <complex>

#include <string>

#include <iomanip>

#include <sstream>

#include <bitset>

#include <valarray>

#include <functional>

#include <assert.h>

using namespace std;

typedef long long int ll;

typedef unsigned int uint;

typedef unsigned char uchar;

typedef unsigned long long ull;

typedef pair<int, int> pii;

typedef vector<int> vi;



#define REP(i,x) for(int i=0;i<(int)(x);i++)

#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();i++)

#define RREP(i,x) for(int i=((int)(x)-1);i>=0;i--)

#define RFOR(i,c) for(__typeof((c).rbegin())i=(c).rbegin();i!=(c).rend();i++)

#define ALL(container) container.begin(), container.end()

#define RALL(container) container.rbegin(), container.rend()

#define SZ(container) ((int)container.size())

#define mp(a,b) make_pair(a, b)

#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );



template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }

template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }

template<class T> ostream& operator<<(ostream &os, const vector<T> &t) {

os<<"["; FOR(it,t) {if(it!=t.begin()) os<<","; os<<*it;} os<<"]"; return os;

}

template<class T> ostream& operator<<(ostream &os, const set<T> &t) {

os<<"{"; FOR(it,t) {if(it!=t.begin()) os<<","; os<<*it;} os<<"}"; return os;

}

template<class S, class T> ostream& operator<<(ostream &os, const pair<S,T> &t) { return os<<"("<<t.first<<","<<t.second<<")";}



const double EPS = 1e-8;

const int MOD = 1000000007;







template <typename Weight>

struct MaxFlow{

	struct Edge{

		int v;

		Weight w;

		int r;

		Edge(int v, Weight w,int r=0):v(v),w(w),r(r){}

	};

	typedef vector< vector<Edge> > Graph;

	int n, source, sink;

	Graph g;

	Weight flow;

	MaxFlow(int n=0, int s=0, int t=0):n(n), g(n), flow(0), source(s), sink(t){

		

	}

	

	void add_edge(int u, int v, Weight cap, Weight revcap=0){

		g[u].emplace_back(v,cap,g[v].size());

		g[v].emplace_back(u,revcap,g[u].size()-1);

	}

	void rem_edge(int u,int v, Weight cap){

		for(auto &e : g[u])if(e.v == v){

			Weight t = min(cap, e.w);

			e.w -= t;

			cap -= t;

			if(cap == 0) return;

		}

		Weight t = cap;

		cap -= maxflow_dinic(u, v, cap);

		if(cap){

			maxflow_dinic(sink, v, cap);

			maxflow_dinic(u, source, cap);

			flow -= cap;

		}

		rem_edge(v, u, t);

	}

	

	Weight maxflow_dinic(int source, int sink, Weight limit){

		if(source == sink) return limit;

		const Weight inf = numeric_limits<Weight>::max();

		Weight flow = 0;

		while(true){

			vector<int> level(n, -1);

			queue<int> q;

			level[source] = 0;

			q.push(source);

			while(!q.empty()){

				const int u = q.front(); q.pop();

				for(const auto &e : g[u]){

					const int v = e.v;

					if(e.w <= 0 || level[v] >= 0){ continue; }

					level[v] = level[u] + 1;

					q.push(v);

				}

			}

			if(level[sink] < 0){ break; }

			vector<size_t> itr(n, 0);

			while(true){

				function<Weight(int, Weight)> dfs =

					[&](int u, Weight limit) -> Weight{

						if(u == sink) return limit;

						for(; itr[u] < g[u].size(); ++itr[u]){

							auto &e = g[u][itr[u]];

							const int v = e.v;

							if(e.w <= 0 || level[u] >= level[v]){ continue; }

							const Weight diff = dfs(v, min(e.w, limit));

							if(diff > 0){

								e.w -= diff;

								g[v][e.r].w += diff;

								return diff;

							}

						}

						return 0;

					};

				const auto f = dfs(source, limit - flow);

				if(f <= 0) break;

				if((flow += f) == limit) return flow;

			}

		}

		return flow;

	}

	Weight maxflow(){

		return flow += maxflow_dinic(source, sink, numeric_limits<Weight>::max());

	}

};



int N, E, Q;

main(){

	ios::sync_with_stdio(false);

	cin >> N >> E >> Q;

	MaxFlow<int> g(N, 0, N-1);

	REP(i, E){

		int u, v;

		cin >> u >> v;u--;v--;

		g.add_edge(u, v, 1, 1);

	}

	REP(i, Q){

		int u, v, f;

		cin >> f >> u >> v; u--; v--;

		if(f == 1){

			g.add_edge(u, v, 1, 1);

		}else{

			g.rem_edge(u, v, 1);

			g.rem_edge(v, u, 1);

		}

		cout << g.maxflow() << endl;

	}

	return 0;

}

// Fastest known solution for this problem: