import java.util.*;
import java.lang.*;
import java.io.*;
import java.math.*;
class Ideone
{
{
Scanner in
= new Scanner
(System.
in); double currentNumber = in.nextDouble();
double previousNumber = 0;
double position = 0;
for(; currentNumber >= 0; position++){
previousNumber = currentNumber;
currentNumber = in.nextDouble();
}
double result = position + previousNumber;
}
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CmltcG9ydCBqYXZhLm1hdGguKjsKCmNsYXNzIElkZW9uZQp7CglwdWJsaWMgc3RhdGljIHZvaWQgbWFpbiAoU3RyaW5nW10gYXJncykgdGhyb3dzIGphdmEubGFuZy5FeGNlcHRpb24KCXsKCQlTY2FubmVyIGluID0gbmV3IFNjYW5uZXIoU3lzdGVtLmluKTsKCQlkb3VibGUgY3VycmVudE51bWJlciA9IGluLm5leHREb3VibGUoKTsKCQlkb3VibGUgcHJldmlvdXNOdW1iZXIgPSAwOwoJCWRvdWJsZSBwb3NpdGlvbiA9IDA7CgkJZm9yKDsgY3VycmVudE51bWJlciA+PSAwOyBwb3NpdGlvbisrKXsKCQkJcHJldmlvdXNOdW1iZXIgPSBjdXJyZW50TnVtYmVyOwoJCQljdXJyZW50TnVtYmVyID0gaW4ubmV4dERvdWJsZSgpOwoJCX0KCQlkb3VibGUgcmVzdWx0ID0gcG9zaXRpb24gKyBwcmV2aW91c051bWJlcjsKCQlTeXN0ZW0ub3V0LnByaW50bG4ocmVzdWx0KTsJCgl9Cn0=