#include <iostream>

int main() {
    unsigned int sum = 0;
    while (true) {
        int num;
        std::cin >> num;
        if (num == 0) {
            break;
        }
        if (num < 0) {
            std::cout << "You are a bad person!\n";
            return 0;
        }
        sum += num;
    }
    if (sum > 1000) {
        sum += sum * 2 / 10;
    } else if (sum < 500) {
        sum -= sum / 10;
    }
    std::cout << sum << '\n';
}
