#include <bits/stdc++.h>
using namespace std;

int main() {
    int x, y, f;
    cin >> x >> y >> f;
    cout << min(x * 12, y * 12 + f) << '\n';
}
