Sample challenge

A task we encounter every day is data compression. Sending large files takes a lot of time and we would like to do it as fast as we can. For really big files it is faster to first compress them, then send them, and finally to decompress on the receiver's computer than just to send the file. Here we face such a problem. We have a text file and three rules supported by the decompression routine, and we would like to design a compatible compressor. The shorter the resulting file is, the better the compression procedure. The decompression rules are as follows:

  1. when reading a letter 'a'-'z', print this letter,
  2. when reading the symbol '+', look at the number n following it and print the last n letters again,
  3. when reading the symbol '-', look at the number n following it and erase the last n letters.

Input

One line with text to compress.

Output

One line with compressed text.

Score

Score is sum of all letters of all texts after compression.

Example
input
abcabcabcabdddddd

output
abc+3+6-1ddd+3

score
14

Sample solutions


function foo(items) { var x = "All this is syntax highlighted"; return x; }