#include <bits/stdc++.h>
using namespace std;
//
const int mx = 1e5 + 5;
const int S = 320;
//
struct hash_pair
{
    template <class T1, class T2>
    size_t operator () (const pair<T1, T2> &p) const
    {
        size_t hash1 = hash<T1>{}(p.first);
        size_t hash2 = hash<T2>{}(p.second);
        //
        return hash1 ^ (hash2 + 0x9e3779b9 + (hash1 << 6) + (hash1 >> 2));
    }
};
//
namespace real
{
    int cnt, lab[mx];
    //
    void reset (int n)
    {
        cnt = n;
        memset(lab, -1, sizeof lab);
    }
    int find_set (int v)
    {
        return lab[v] < 0 ? v : lab[v] = find_set(lab[v]);
    }
    void union_sets (int u, int v)
    {
        u = find_set(u);
        v = find_set(v);
        if (u == v)
            return;
        --cnt;
        if (lab[u] > lab[v])
            swap(u, v);
        lab[u] += lab[v];
        lab[v] = u;
    }
}
namespace vir
{
    int n, cnt, lab[mx];
    unordered_map<int, int> mp;
    //
    void reset (void)
    {
        mp.clear();
        fill(lab + 1, lab + cnt + 1, 0);
        n = cnt = 0;
    }
    void make_set (int u)
    {
        ++n, ++cnt;
        mp[u] = n;
        lab[n] = -1;
    }
    int find_set (int v)
    {
        return lab[v] < 0 ? v : lab[v] = find_set(lab[v]);
    }
    void union_sets (int u, int v)
    {
        if (mp.find(u) == mp.end())
            make_set(u);
        u = find_set(mp[u]);
        if (mp.find(v) == mp.end())
            make_set(v);
        v = find_set(mp[v]);
        if (u == v)
            return;
        --cnt;
        if (lab[u] > lab[v])
            swap(u, v);
        lab[u] += lab[v];
        lab[v] = u;
    }
}
//
void process (void)
{
    int n, m, k;
    int a, b, lim, t[mx];
    pair<int, int> p[mx];
    unordered_set<pair<int, int>, hash_pair> edge, temp, delete_set;
    //
    cin >> n >> m >> k;
    for (int i = 0; i < m; ++i)
    {
        cin >> a >> b;
        if (a > b)
            swap(a, b);
        edge.insert(make_pair(a, b));
    }
    for (int i = 0; i < k; ++i)
    {
        cin >> t[i] >> a >> b;
        if (a > b)
            swap(a, b);
        p[i] = make_pair(a, b);
    }

    real::reset(n);
    for (auto it : edge)
        real::union_sets(it.first, it.second);
    cout << real::cnt;

    for (int i = 0; i * S < k; ++i)
    {
        lim = min(k, (i + 1) * S);

        delete_set.clear();
        for (int j = i * S; j < lim; ++j)
            if (t[j] == 2)
                delete_set.insert(p[j]);

        real::reset(n);
        temp.clear();
        for (auto it : edge)
            if (delete_set.find(it) == delete_set.end())
                real::union_sets(it.first, it.second);
            else
                temp.insert(it);

        for (int j = i * S; j < lim; ++j)
        {
            if (t[j] == 1)
                edge.insert(p[j]);
            else
                edge.erase(p[j]),
                temp.erase(p[j]);

            vir::reset();
            for (auto it : temp)
                vir::union_sets(real::find_set(it.first), real::find_set(it.second));
            for (int d = i * S; d <= j; ++d)
                if (t[d] != 2 && edge.find(p[d]) != edge.end())
                    vir::union_sets(real::find_set(p[d].first), real::find_set(p[d].second));

            cout << ' ' << real::cnt - (vir::n - vir::cnt);
        }
    }
}
//
signed main (void)
{
    ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
    process();
}
