#include using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (ll)(n); i++) #define oke cout << "Yes" << '\n'; #define dame cout << "No" << '\n'; #define all(a) a.begin(), a.end() #define rall(a) a.rbegin(), a.rend() using HaiI = vector>; using Hai2 = vector>; using HaiB = vector>; using Hai3 = vector>>; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cout << fixed << setprecision(15); ll N; cin>>N; vectorL(N); vectorR(N); vectorS(N); rep(i,N){ cin>>L[i]>>R[i]; S[i]=i; } ll cut=0; do{ ll mi=-1; bool aori=false; rep(i,N){ if(mi <= R[S[i]]){ mi=max(mi,L[S[i]]); }else{ aori=true; } } if(!aori){ cut++; } }while(next_permutation(all(S))); cout<