#include <bits/stdc++.h>
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)
#define ALL(x) (x).begin(),(x).end()
#define RALL(x) (x).rbegin(),(x).rend()
#define SIZE(x) ((ll)(x).size())
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
typedef long long ll;
const int INF = INT32_MAX;
using P = pair<int, int>;

int main() {
    int x, y, z;
    cin >> x >> y >> z;
    
    int ans = y*z/x;
    if(y*z == ans*x){
        ans--;
    }
    if(ans < 0) ans= 0;

    cout << ans << endl;

    return 0;
}
#include <bits/stdc++.h>
using namespace std;
#define END '\n'
#define ll long long
#define pb push_back
#define pii pair<int, int>
#define ff first
#define ss second
#define bug(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
#define loop(i, a, b) for(int i = (a); i < (b); i++)
#define loopb(i, b, a) for(int i = (b); i > (a); --i) 
const int mod = 1e9+7;
const int mod1 = 998244353;
const ll inf = 1e14;
const int nax = 200005;
int n,q,a,b,type,c[nax],grp[nax],sz[nax];
map<int,int> adj[nax];
int get(int x)
 {
  if(grp[x] != x)
     grp[x] = get(grp[x]);
  return grp[x];
 }
void dsu(int x, int y)
 {
  x = get(x);
  y = get(y);
  if(sz[x] > sz[y])
     swap(x,y);
  if(x == y)
     return;
  sz[y] += sz[x]; 
  grp[x] = y;
  for(auto P : adj[x])
     adj[y][P.ff] += P.ss;
 }
void solve()
 {
  cin>>n>>q;
  loop(i,1,n+1)
   {
    cin>>c[i];
    sz[i] = 1;
    grp[i] = i;
    adj[i][c[i]]++;
   }
  loop(i,0,q)
   {
    cin>>type>>a>>b;
    if(type == 1)
      dsu(a,b);
    else
      cout<<adj[get(a)][b]<<END;
   }
 }
int32_t main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  /*int t;
  cin>>t;
  while(t--)  */
   solve();
  return 0;
}    
