import java.util.stream.IntStream;
class Main {
public static void main
(String[] args
) {
IntStream stream = IntStream.range(1, 1000);
long result = stream.reduce(0, (sum, value) -> (value % 3 == 0 || value % 5 == 0) ? sum+value : sum);
}
}
aW1wb3J0IGphdmEudXRpbC5zdHJlYW0uSW50U3RyZWFtOwoKY2xhc3MgTWFpbiB7CiAgcHVibGljIHN0YXRpYyB2b2lkIG1haW4oU3RyaW5nW10gYXJncykgewogICAgICAKICAgIEludFN0cmVhbSBzdHJlYW0gPSBJbnRTdHJlYW0ucmFuZ2UoMSwgMTAwMCk7CiAgICBsb25nIHJlc3VsdCA9IHN0cmVhbS5yZWR1Y2UoMCwgKHN1bSwgdmFsdWUpIC0+ICh2YWx1ZSAlIDMgPT0gMCB8fCB2YWx1ZSAlIDUgPT0gMCkgPyBzdW0rdmFsdWUgOiBzdW0pOwogICAgCiAgICBTeXN0ZW0ub3V0LnByaW50bG4ocmVzdWx0KTsKICB9Cn0=