 # Russian Doll Envelopes

Given a matrix of integers A of size N x 2 describing dimensions of N envelopes,
where A[i] denotes the height of the ith envelope and
A[i] denotes the width of the ith envelope.

One envelope can fit into another
if and only if both the width and height of one envelope is greater than the width and height of the other envelope.

Find the maximum number of envelopes you can put one inside other.

Input Format

``````The only argument given is the integer matrix A.
``````

Output Format

``````Return the maximum number of envelopes you can put one inside other.
``````

Constraints

``````1 <= N <= 1000
1 <= A[i], A[i] <= 10^9
``````

For Example

``````Input 1:
A = [   [5, 4]
[6, 4]
[6, 7]
[2, 3]   ]
Output 1:
3
Explanation 1:
Step 1: put [2, 3] inside [5, 4]
Step 2: put [5, 4] inside [6, 7]

Input 2:
A = A : [   [8, 9]
[8, 18] ]
Output 2:
1
Explanation 2:
No envelopes can be put inside any other so answer is 1.
``````
NOTE: You only need to implement the given function. Do not read input, instead use the arguments to the function. Do not print the output, instead return values as specified. Still have a doubt? Checkout Sample Codes for more details. 