#include <bits/stdc++.h>
using namespace std;
int main() {
priority_queue<int, vector<int>, greater<int> > pq;
int a[] = {2,3,5,7,9};
int n = sizeof(a)/sizeof(int);
for (int i=0; i<n; ++i) pq.push(a[i]);
int res = 0;
while (pq.size() > 1) {
int a = pq.top();pq.pop();
int b = pq.top();pq.pop();
res += (a+b);
}
cout << res << endl;
return 0;
}