using namespace std;
int main() {
int n; int sum = 0; while (cin>>n) { if (n == 0) { break; } else if(n<0) { continue; } else { sum += n; }
} cout << sum;
}