A - タブの開きすぎ

やるだけ。なのでbefungeで書いてみた。しかし末尾の空白で拒絶されやる気を削がれ、B以降が話題になっていたこともあって、pythonでさくっと書き直した。

#!/usr/bin/env python3
n, l = map(int,input().split())
s = input()
ans, t = 0, 1
for c in s:
    t += { '+': 1, '-': -1 }[c]
    if t > l:
        ans, t = ans+1, 1
print(ans)