• [1298] Death Moon's Inspiration

  • 时间限制: 1000 ms 内存限制: 65535 K
  • 问题描述
  • Death moon never lack of funny storys, because he is fond of collect them. To get more inspiration, he went to the gate of a pub and kept a careful record of all visitors. Each time a visitor entered the pub, death moon put down character "+" in his notes. Similarly, each time a visitor left the pub, he put character "-" in his notes. Death moon doesn't remember whether there was somebody in the pub at the moment when his shift begun and at the moment when it ended. Now he wonders what minimum number of distinct people he could have seen. Assume that he sees anybody coming in or out of the pub. Each person could have come in or out an arbitrary number of times.

  • 输入
  • The only line of the input contains a sequence of characters "+" and "-". The characters are written in the order, in which the corresponding events occurred. The given sequence has length from 1 to 300 characters, inclusive.
  • 输出
  • Print the minimum number of people that death moon could see
  • 样例输入
  • +-+-+
  • 样例输出
  • 1
  • 提示
  • For the first case, if there is only one people come in and go out, well, that's the mininum number of
    people. For the second case, three "go out", so we need at least three people to finish it.
  • 来源
  • Mr. Cai
  • 操作