You are given boxes and each box contains two small boxes of Red and Blue color. The size of the Red and Blue colored boxes are and respectively.
Consider a sequence of distinct integers .
Consider to be a suitable sequence if, for every .
Determine the maximum possible size of the suitable sequence.
Input format
Output format
Print only one integer representing the size of the maximum suitable sequence.
sequence is suitable since and . Its size is 2 and it can be shown that we can't arrange all 3 girls to form a suitable sequence of size .