def parse(inFile):
return inFile.readline()
def solve(text):
N = len(text)
x = [1 if c == "w" else 0 for c in text]
for c in "elcome to code jam":
x = [0] + [(sum(x[:i]) % 10000) if text[i] == c else 0 for i in xrange(1, N)]
return "%04d" % (sum(x) % 10000)
if __name__ == "__main__":
from GCJ import GCJ
GCJ(parse, solve, "/Users/lpebody/gcj/2009_q/", "c").run()
ZGVmIHBhcnNlKGluRmlsZSk6CiAgICByZXR1cm4gaW5GaWxlLnJlYWRsaW5lKCkKCmRlZiBzb2x2ZSh0ZXh0KToKICAgIE4gPSBsZW4odGV4dCkKICAgIHggPSBbMSBpZiBjID09ICJ3IiBlbHNlIDAgZm9yIGMgaW4gdGV4dF0KICAgIGZvciBjIGluICJlbGNvbWUgdG8gY29kZSBqYW0iOgogICAgICAgIHggPSBbMF0gKyBbKHN1bSh4WzppXSkgJSAxMDAwMCkgaWYgdGV4dFtpXSA9PSBjIGVsc2UgMCBmb3IgaSBpbiB4cmFuZ2UoMSwgTildCiAgICByZXR1cm4gIiUwNGQiICUgKHN1bSh4KSAlIDEwMDAwKQoKaWYgX19uYW1lX18gPT0gIl9fbWFpbl9fIjoKICAgIGZyb20gR0NKIGltcG9ydCBHQ0oKICAgIEdDSihwYXJzZSwgc29sdmUsICIvVXNlcnMvbHBlYm9keS9nY2ovMjAwOV9xLyIsICJjIikucnVuKCkK