#include #include #include using namespace std; int DP[61]; int main() { for (int j = 0; j < 61; j++)DP[j] = INT32_MAX; vectorv(4),n(4); cin >> v[0] >> v[1] >> v[2] >> v[3]; sort(v.begin(), v.end()); int a = v[0]; for (int i = 1; i < 4; i++) { if (v[i] == a) { cout << 4 << endl; return 0; } a = v[i]; } DP[0] = 0; int ans = 3; for (int i = 0; i < 3; i++) { for (int j = 0; j < 31; j++) { if (DP[j] == INT32_MAX)continue; DP[j + v[i]] = min(DP[j + v[i]], DP[j] + 1); } n[i+1] = DP[v[i+1]]; //cout << n[i+1] << endl; //if (n[i + 1] == INT32_MAX)ans++; } sort(n.begin(), n.end()); int nok = 3 - ans; //for (int i = 1; i <= nok; i++) { ans += n[1]; //} cout << ans << endl; return 0; }