#include using namespace std; int main () { int n; cin >> n; vector arr (n); for (int i = 0; i < n; i++) cin >> arr[i]; sort(arr.begin(),arr.end()); reverse(arr.begin(),arr.end()); long long anw = 0; for (int i = 0; i < n; i++) anw += (1LL<