#C8991. Maximum Non-overlapping Activities

    ID: 53034 Type: Default 1000ms 256MiB

Maximum Non-overlapping Activities

Maximum Non-overlapping Activities

You are given \(N\) activities. Each activity is characterized by a start time \(s\) and an end time \(e\). Two activities are considered non-overlapping if the start time of one is greater than or equal to the end time of the other. Your task is to determine the maximum number of non-overlapping activities you can attend.

The activities are provided via the standard input, and your answer should be printed to the standard output.

inputFormat

The input is read from standard input. The first line contains a single integer \(N\) representing the number of activities. Each of the following \(N\) lines contains two integers \(s\) and \(e\), representing the start and end times of an activity respectively.

outputFormat

The output should be a single integer representing the maximum number of non-overlapping activities that can be selected.

## sample
3
1 2
3 4
0 6
2

</p>