#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<string>
#include<stack>
#include<cstdio>
#include<cmath>
using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<int,P> P1;

#define fr first
#define sc second
#define mp make_pair
#define pb push_back
#define rep(i,x) for(int i=0;i<x;i++)
#define rep1(i,x) for(int i=1;i<=x;i++)
#define rrep(i,x) for(int i=x-1;i>=0;i--)
#define rrep1(i,x) for(int i=x;i>0;i--)
#define sor(v) sort(v.begin(),v.end())
#define rev(s) reverse(s.begin(),s.end())
#define lb(vec,a) lower_bound(vec.begin(),vec.end(),a)
#define ub(vec,a) upper_bound(vec.begin(),vec.end(),a)
#define uniq(vec) vec.erase(unique(vec.begin(),vec.end()),vec.end())
#define mp1(a,b,c) P1(a,P(b,c))

const int INF=1000000000;
const int dir_4[4][2]={{1,0},{0,1},{-1,0},{0,-1}};
const int dir_8[8][2]={{1,0},{1,1},{0,1},{-1,1},{-1,0},{-1,-1},{0,-1},{1,-1}};

int n;

const int MAX_V_flow = 510;
struct FLOW{
	vector<P1> G[MAX_V_flow];
	map<int,int> id[MAX_V_flow];
	bool used[MAX_V_flow];
	
	void init(){
		rep(i,MAX_V_flow)G[i].clear();
	}
	
	void add_edge(int from,int to,int flow){
		id[from][to] = G[from].size();
		id[to][from] = G[to].size();
		G[from].pb( mp1 ( to , flow , G[to].size() ) );
		G[to].pb( mp1 ( from , flow , G[from].size()-1 ) );
	}
	
	int erase_edge(int from,int to){
		int s = id[from][to];
		int t = id[to][from];
		int ret = 0;
		//cout << G[from][s].sc.fr << " " << G[to][t].sc.fr << endl;
		if(G[from][s].sc.fr == 2){
			G[from][s].sc.fr = 0;
			G[to][t].sc.fr = 0;
			ret = 1;
			rep(i,MAX_V_flow)used[i] = false;
			ret = min ( ret , dfs(n,from,1) );
			if(ret != 0){
				rep(i,MAX_V_flow)used[i] = false;
				ret = min ( ret , dfs(to,1,1) );
				if(ret == 0){
					rep(i,MAX_V_flow)used[i] = false;
					dfs(from,n,1);
				}
			}
			if(ret == 0){
				rep(i,MAX_V_flow)used[i] = false;
				dfs(to,from,1);
			}
		}
		else if(G[to][t].sc.fr == 2){
			G[from][s].sc.fr = 0;
			G[to][t].sc.fr = 0;
			ret = 1;
			rep(i,MAX_V_flow)used[i] = false;
			ret = min ( ret , dfs(n,to,1) );
			if(ret != 0){
				rep(i,MAX_V_flow)used[i] = false;
				ret = min ( ret , dfs(from,1,1) );
				if(ret == 0){
					rep(i,MAX_V_flow)used[i] = false;
					dfs(to,n,1);
				}
			}
			if(ret == 0){
				rep(i,MAX_V_flow)used[i] = false;
				dfs(from,to,1);
			}
		}
		G[from][s].sc.fr = 0;
		G[to][t].sc.fr = 0;
		return ret;
	}
	
	int dfs(int v,int t,int f){
		//printf("%d %d %d\n",v,t,f);
		if(v == t)return f;
		used[v] = true;
		rep(i,G[v].size()){
			if(!used[G[v][i].fr] && G[v][i].sc.fr > 0){
				int d = dfs(G[v][i].fr,t,min(f,G[v][i].sc.fr));
				if(d > 0){
					G[v][i].sc.fr -= d;
					G[G[v][i].fr][G[v][i].sc.sc].sc.fr += d;
					return d;
				}
			}
		}
		return 0;
	}
	
	int flow(int s,int t){
		int ret = 0,d = 1;
		while(d > 0){
			rep(i,MAX_V_flow)used[i] = false;
			d = dfs(s,t,INF);
			ret += d;
		}
		return ret;
	}
}flow;

int main(){
	int e,q;
	scanf("%d%d%d",&n,&e,&q);
	
	rep(i,e){
		int f,t;
		scanf("%d%d",&f,&t);
		flow.add_edge(f,t,1);
	}
	int ret = flow.flow(1,n);
	rep(i,q){
		int m,a,b;
		scanf("%d%d%d",&m,&a,&b);
		if(m == 1){
			flow.add_edge(a,b,1);
		}
		else {
			ret -= flow.erase_edge(a,b);
		}
		ret += flow.flow(1,n);
		printf("%d\n",ret);
	}
}

Measured memory_bytes: 3784