You are given a sequence of distinct integers a1,a2,…,an and an integer x and you have to perform the following operations:
What is the minimum cost to erase the whole sequence?
Input format
Output format
Print an integer denoting the minimum cost to erase the whole sequence.
One way to remove all the elements with the cost of 2 is to perform the first operation once and pay 1. Then perform the second operation and pay 1 and then do the second operation twice and pay 0.