#include <bits/stdc++.h>
using namespace std;
#define FOR(i,k,n) for(int i = (int)(k); i < (int)(n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) a.begin(), a.end()
#define MS(m,v) memset(m,v,sizeof(m))
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int, int> pii;
const int MOD = 1000000007;
const int INF = MOD + 1;
const ld EPS = 1e-12;
template<class T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template<class T> T &chmax(T &a, const T &b) { return a = max(a, b); }

/*--------------------template--------------------*/

typedef int Weight;
typedef int Flow;
struct Edge {
	int src, dest, rev;
	Flow cap;
	Weight cost;
	bool operator < (const Edge &rhs) const
	{
		return cost > rhs.cost;
	}
	Edge(int s, int d) : src(s), dest(d) { ; }
	Edge(int s, int d, int c) : src(s), dest(d), cost(c) { ; }
	Edge(int s, int t, Flow f, int r) : src(s), dest(t), cap(f), rev(r) {}
	Edge(int s, int d, int r, Flow cp, Weight cst) : src(s), dest(d), rev(r), cap(cp), cost(cst) { ; }
};
typedef vector<Edge> Edges;
typedef vector<Edges> Graph;
typedef vector<Weight> Array;
typedef vector<Array> Matrix;
void add_edge(Graph &g, int src, int dest, Flow cap)
{
	g[src].push_back(Edge{ src, dest, (int)g[dest].size(), cap, 0 });
	g[dest].push_back(Edge{ dest, src, (int)g[src].size() - 1, 0, 0 });
}

void add_edge(Graph &g, int from, int to, Flow cap, Weight cost)
{
	g[from].push_back(Edge(from, to, (int)g[to].size(), cap, cost));
	g[to].push_back(Edge(to, from, (int)g[from].size() - 1, 0, -cost));
}


Flow dfs(Graph &g, vector<bool> &used, int v, int t, Flow f)
{
	if (v == t) return f;
	used[v] = true;
	for (Edge& e : g[v])
	{
		if (!used[e.dest] && e.cap > 0)
		{
			Flow d = dfs(g, used, e.dest, t, min(f, e.cap));
			if (d > 0)
			{
				e.cap -= d;
				g[e.dest][e.rev].cap += d;
				return d;
			}
		}
	}
	return 0;
}

Flow max_flow(Graph &g, int s, int t)
{
	Flow flow = 0;
	for (;;)
	{
		vector<bool> used(g.size(), false);
		Flow f = dfs(g, used, s, t, INF);
		if (f == 0) return flow;
		flow += f;
	}
}

Flow unit_flow(Graph &g, int s, int t)
{
	Flow flow = 0;
	vector<bool> used(g.size(), false);
	Flow f = dfs(g, used, s, t, 1);
	flow += f;
	return flow;
}

int main()
{
	cin.sync_with_stdio(false); cout << fixed << setprecision(10);
	int n, e, q;
	cin >> n >> e >> q;
	Graph g(n);
	REP(i, n)REP(j, n)
	{
		g[i].emplace_back(i, j, 0, i);
	}
	REP(i, e)
	{
		int a, b; cin >> a >> b;
		a--; b--;
		g[a][b].cap++;
		g[b][a].cap++;
	}
	int tmp = max_flow(g, 0, n - 1);
	REP(i, q)
	{
		int a, b, c;
		cin >> c >> a >> b;
		a--; b--;
		if (c == 1)
		{
			assert(g[a][b].cap == 0 && g[b][a].cap == 0);
			g[a][b].cap++;
			g[b][a].cap++;
			tmp += unit_flow(g, 0, n - 1);
		}
		if (c == 2)
		{
			assert(g[a][b].cap != 0 || g[b][a].cap != 0);
			if (g[a][b].cap == 1 && g[b][a].cap == 1)
			{
			}
			else if (g[a][b].cap == 2 && g[b][a].cap == 0)
			{
				if (unit_flow(g, b, a) == 0)
				{
					tmp--;
					unit_flow(g, b, 0);
					unit_flow(g, n - 1, a);
				}
			}
			else if (g[a][b].cap == 0 && g[b][a].cap == 2)
			{
				if (unit_flow(g, a, b) == 0)
				{
					tmp--;
					unit_flow(g, a, 0);
					unit_flow(g, n - 1, b);
				}
			}
			else assert(false);
			g[a][b].cap = g[b][a].cap = 0;
		}
		cout << tmp << endl;
	}
	return 0;
}

Measured memory_bytes: 7880