#include #include #include using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n; cin >> n; vector a(n); for(int& x : a) cin >> x; auto m1 = min_element(a.begin(), a.end()); auto v1 = *m1; a.erase(m1); auto m2 = min_element(a.begin(), a.end()); cout << v1 + *m2 << endl; }