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

int main(){
  int n;
  cin>>n;
  vector<int>x(n);
  vector<int>y(n);
  for(int i=0;i<n;i++){
    cin>>x[i]>>y[i];
  }
  sort(x.begin(),x.end());
  sort(y.begin(),y.end());
  int ans;
  if(n%2==1){
    cout<<y[n/2]-x[n/2]+1<<endl;
    return 0;
  }
  else{
    cout<<(y[n/2]+y[n/2-1])-(x[n/2]+x[n/2-1])+1<<endl;
  }
}
