/*
TASK: man
LANG: C++
*/
#include <iostream>
#include <vector>
using namespace std;
short int a[15000][15000];
int m;
int u[15000];
vector <int> v,b[15000];
int main()
{
    cin >> m;
    int i,j,x,y;
    for (i=0; i<m; i++)
    {
        cin >> x >> y;
        if (u[x]==0)
        {
                    v.push_back(x);
                    u[x]=1;
        }
        if (u[y]==0)
        {
                    v.push_back(y);
                    u[y]=1;
        }
        a[x][y]=a[y][x]=1;
        b[x].push_back(y);
        b[y].push_back(x);
    }
    int br=m;
    while (v.size()>0)
    {
          x=v.back();
          v.pop_back();
          for (i=0; i<b[x].size(); i++)
           if (b[x][i]!=-1 && a[x][b[x][i]]==1)
            for (j=0; j<b[x].size(); j++)
             if (j!=i && a[x][b[x][j]]==1 && a[b[x][i]][b[x][j]]==1)
             {
                      a[x][b[x][j]]=0;
                      a[b[x][j]][x]=0;
                      b[x][j]=-1;
                      br--;
             }
    }
    cout << br << '\n';
    return 0;
}
