require 'set'

class Graph
	def initialize(*options)
		@options = Set[*options]
	end

	def add_node(property = {})
		Node.new(property)
	end

	def add_edge(u, v, property = {})
		e = Edge.new(u, v, property)
		u.add_edge(e)
		v.add_edge(e)
		e
	end
	
	def del_edge(e)
		u, v = e.opposite.keys
		u.del_edge(e)
		v.del_edge(e)
	end

	class Node
		def initialize(property)
			@property = property
			@edges = Set.new
		end

		def add_edge(e)
			@edges << e
		end

		def del_edge(e)
			@edges.delete(e)
		end

		def to_s
			@property[:name] || super
		end

		def each_edge
			@edges.each{|e| 
				yield e
			}
		end

		attr_reader :property
	end

	class Edge
		def initialize(u, v, property)
			@opposite = {u => v, v => u}
			@property = property
		end
		attr_reader :opposite, :property

		def to_s
			@property[:name] || super
		end

		def length
			@property[:length] || 1
		end

		def actual_capacity(from)
			v = @opposite[from]
			cap = @property[:capacity]
			flow = (@property[:flow] ||= 0)
			to = (@property[:flow_to] ||= v)
			to == v ? cap - flow : cap + flow
		end
	end

	def each_out_connection_of(u)
		u.each_edge{|e|
			yield(e.opposite[u], e.length)
		}
	end

	alias :each_in_connection_of :each_out_connection_of

	def get_augmenting_path(s, t)
		reached = Set[s]
		queue = [s]
		comming_edge = {}
		until queue.empty?
			u = queue.shift
			u.each_edge do |e|	
				v = e.opposite[u]
				next if reached.include?(v)
				next if e.actual_capacity(u) <= 0

				reached << v
				comming_edge[v] = e
				queue << v

				if v == t
					queue = []
					break
				end
			end	
		end

		if comming_edge[t]
			path = [t]
			v = t
			until path[-1] == s
				e = comming_edge[v]
				u = e.opposite[v]
				path << e
				path << u
				v = u
			end
			return path.reverse
		end

		return nil
	end
end

def add_flow(df, path)
	path.each_slice(2) do |u, e|
		break if !e
		v = e.opposite[u]

		cap = e.property[:capacity]
		flow = e.property[:flow]
		to = e.property[:flow_to]

		if to == v 
			e.property[:flow] += df
		elsif flow >= df
			e.property[:flow] -= df
		else
			e.property[:flow_to] = v
			e.property[:flow] = df - flow
		end
	end
end

n, m, q = gets.split.map(&:to_i)	
g = Graph.new
nodes = (0..n).map { g.add_node }
edges = {}

m.times do
	i, j = gets.split.map(&:to_i)
	i, j = j, i if j < i
	e = g.add_edge(nodes[i], nodes[j], {:capacity => 1})
	edges[[i, j]] = e
end

flow = 0
loop do
	path = g.get_augmenting_path(nodes[1], nodes[n])
	break if !path
	add_flow(1, path)
	flow += 1
end

q.times do
	command, i, j = gets.split.map(&:to_i)
	i, j = j, i if j < i
	if command == 1
		e = g.add_edge(nodes[i], nodes[j], {:capacity => 1})
		edges[[i, j]] = e
	else
		e = edges[[i, j]]
		g.del_edge(e)
		edges.delete([i, j])

		if (e.property[:flow] || 0) != 0
			nodes[i]
			v = e.property[:flow_to]
			if v != nodes[n]
				path = g.get_augmenting_path(nodes[n], v)
				add_flow(1, path)
			end
			u = e.opposite[v]
			if u != nodes[1]
				path = g.get_augmenting_path(u, nodes[1])
				add_flow(1, path)
			end
			flow -= 1
		end
	end

	if path = g.get_augmenting_path(nodes[1], nodes[n])
		add_flow(1, path)
		flow += 1
	end

	p flow
end