/*
TASK: man
LANG: C++
*/
#include<iostream>
#include<algorithm>
#include<cmath>
using namespace std;
int a[5000][5000],n,p=0;

int main()
{
    int i,j,d;
    cin>>n;
    int z[1000];

    for ( d=0; d<n; d++ )
    {   cin >>i>>j;z[p]=i;p++;z[p]=j;p++;}
    cout<<n-1;
    cout<<endl;
    system("pause");
    return 0;
}
