#include #include #include #include #include using namespace std; int N; vector v; int main (){ cin >> N; for(int i=0; i> a; v.push_back(a); } sort( v.begin(), v.end()); int cost = 0; for(int i=1; i