#include<bits/stdc++.h>
using namespace std;

class max_flow {
public:
    struct edge {
        int to, cap, rev;
        edge(int t, int c, int r) : to(t), cap(c), rev(r) {}
    };
private:
    vector<vector<edge>> g;
    vector<int> lev, itr;
    vector<unordered_map<int, vector<int>>> mp;

    void bfs(int s) {
        int n = g.size();
        lev = vector<int>(n, -1);
        queue<int> q;
        lev[s] = 0;
        q.push(s);
        while (!q.empty()) {
            int v = q.front();
            q.pop();
            for (edge& e : g[v]) {
                if (e.cap > 0 && lev[e.to] < 0) {
                    lev[e.to] = lev[v] + 1;
                    q.push(e.to);
                }
            }
        }
    }
    int dfs(int v, int t, int f) {
        if (v == t) return f;
        for (; itr[v] < (int)g[v].size(); ++itr[v]) {
            edge &e = g[v][itr[v]];
            if (e.cap > 0 && lev[v] < lev[e.to]) {
                int d = dfs(e.to, t, min(f, e.cap));
                if (d > 0) {
                    e.cap -= d;
                    g[e.to][e.rev].cap += d;
                    return d;
                }
            }
        }
        return 0;
    }

public:
    max_flow(int n) {
        g = vector<vector<edge>>(n);
        mp = vector<unordered_map<int, vector<int>>>(n);
    }
    void add_edge(int frm, int to, int cap, bool isdir = true) {
        mp[frm][to].push_back(g[frm].size());
        g[frm].push_back(edge(to, cap, g[to].size()));
        mp[to][frm].push_back(g[to].size());
        g[to].push_back(edge(frm, isdir ? 0 : cap, (int)g[frm].size() - 1));
    }

    int inc_cap(int s, int t, int frm, int to, int cap, bool isdir = true) {
        if (!mp[frm].count(to))
            add_edge(frm, to, cap, isdir);
        else {
            int i = mp[frm][to][0];
            g[frm][i].cap += cap;
            if (!isdir)
                g[to][g[frm][i].rev].cap += cap;
        }
        return run(s, t);
    }

    // decrease cap == 1
    int dec_cap(int s, int t, int frm, int to, bool isdir = true) {
        int fi = -1, ti = -1;
        for (int i : mp[frm][to]) {
            if (g[frm][i].cap > 0) {
                fi = i;
                break;
            }
        }
        for (int i : mp[to][frm]) {
            if (g[to][i].cap > 0) {
                ti = i;
                break;
            }
        }
        int u = frm, v = to;
        if (isdir) {
            if (fi != -1) {
                --g[frm][fi].cap;
                return 0;
            }
            --g[to][ti].cap;
        }
        else {
            if (fi != -1 && ti != -1) {
                --g[frm][fi].cap;
                --g[to][ti].cap;
                return 0;
            }
            if (fi != -1) {
                u = to;
                v = frm;
                g[frm][fi].cap -= 2;
            }
            else if (ti != -1) {
                g[to][ti].cap -= 2;
            }
            else assert(0);
        }
        if (run(u, v, 1)) return 0;
        run(u, s, 1);
        run(t, v, 1);
        return -1;
    }


    int run(int s, int t, int lim = INT_MAX) {
        int ret = 0;
        bfs(s);
        while (true) {
            bfs(s);
            if (lev[t] < 0) return ret;
            itr = vector<int>(g.size());
            int f;
            while ((f = dfs(s, t, lim - ret)) > 0) ret += f;
            if (lim == ret) return ret;
        }
    }

};


int main() {
    int n, e, q;
    cin >> n >> e >> q;
    max_flow mf(n);
    for (int i = 0; i < e; ++i) {
        int f, t;
        cin >> f >> t;
        --f;
        --t;
        mf.add_edge(f, t, 1, false);
    }
    int ans = mf.run(0, n - 1);
    for (int i = 0; i < q; ++i) {
        int m, f, t;
        cin >> m >> f >> t;
        --f;
        --t;
        if (m == 1)
            ans += mf.inc_cap(0, n - 1, f, t, 1, false);
        else
            ans += mf.dec_cap(0, n - 1, f, t, false);

        cout << ans << "\n";
    }
    return 0;
}



Measured memory_bytes: 7568