After their adventure with the magic mirror Kay and Gerda have returned home and sometimes give free ice cream to kids in the summer.

At the start of the day they have x ice cream packs. Since the ice cream is free, people start standing in the queue before Kay and Gerda's house even in the night. Each person in the queue wants either to take several ice cream packs for himself and his friends or to give several ice cream packs to Kay and Gerda (carriers that bring ice cream have to stand in the same queue).

If a carrier with d ice cream packs comes to the house, then Kay and Gerda take all his packs. If a child who wants to take d ice cream packs comes to the house, then Kay and Gerda will give him d packs if they have enough ice cream, otherwise the child will get no ice cream at all and will leave in distress.

Kay wants to find the amount of ice cream they will have after all people will leave from the queue, and Gerda wants to find the number of distressed kids.


-----Input-----

The first line contains two space-separated integers n and x (1 ≤ n ≤ 1000, 0 ≤ x ≤ 10^9).

Each of the next n lines contains a character '+' or '-', and an integer d_{i}, separated by a space (1 ≤ d_{i} ≤ 10^9). Record "+ d_{i}" in i-th line means that a carrier with d_{i} ice cream packs occupies i-th place from the start of the queue, and record "- d_{i}" means that a child who wants to take d_{i} packs stands in i-th place.


-----Output-----

Print two space-separated integers — number of ice cream packs left after all operations, and number of kids that left the house in distress.


-----Examples-----
Input
5 7
+ 5
- 10
- 20
+ 40
- 20

Output
22 1

Input
5 17
- 16
- 2
- 98
+ 100
- 98

Output
3 2



-----Note-----

Consider the first sample.  Initially Kay and Gerda have 7 packs of ice cream.  Carrier brings 5 more, so now they have 12 packs.  A kid asks for 10 packs and receives them. There are only 2 packs remaining.  Another kid asks for 20 packs. Kay and Gerda do not have them, so the kid goes away distressed.  Carrier bring 40 packs, now Kay and Gerda have 42 packs.  Kid asks for 20 packs and receives them. There are 22 packs remaining.

Difficulty: interview

Starter code:

Solutions:
n, x = list(map(int, input().split()))
r = 0
for _ in range(n):
    a, b = input().split()
    if a == "+":
        x += int(b)
    else:
        if int(b) <= x:
            x -= int(b)
        else:
            r += 1
print(x, r)


d = 0
a, b = list(map(int, input().split(' ')))
ic = b
for i in range(a):
    x, y = list(map(str, input().split(' ')))
    if (x == '+'):
        ic += int(y)
    else:
        if (int(y) > ic):
            d+=1
        else:
            ic -= int(y)
print(ic, d)


n, x = map(int, input().split())
xx = 0

for _ in range(n):
    s = str(input()).split()
    if s[0] == "+":
        x += int(s[1])
    else:
        if x >= int(s[1]):
            x -= int(s[1])
        else:
            xx += 1

print(x, xx)

n, x = list(map(int, input().split()))
distressed = 0

for i in range(n):
    f = input().split()

    if f[0] == '+':
        x += int(f[1])
    else:
        if x >= int(f[1]):
            x -= int(f[1])
        else:
            distressed += 1

print(x, distressed)


n, x = map(int, input().split())
nm = 0
for i in range(n):
	a, b = map(str, input().split())
	if (a == "+"):
		x += int(b)
	else:
		b = int(b)
		if (x >= b):
			x -= b
		else:
			nm += 1
print(x, nm)

n, x = list(map(int, input().split()))
cur = x
sad = 0
for i in range(n):
    c, m = input().split()
    m = int(m)
    if c == '+':
        cur += m
    else:
        if cur >= m:
            cur -= m
        else:
            sad += 1
print(cur, sad)


n, x = list(map(int, input().split()))

ans = 0
for i in range(n):
    inp = input().split(' ')
    if inp[0] == '+':
        x += int(inp[1])
    else:
        if x >= int(inp[1]):
            x -= int(inp[1])
        else:
            ans += 1

print(x, ans)



from collections import defaultdict, deque, Counter, OrderedDict

def main():
    n, x = map(int,input().split())
    ans = 0
    for _ in range(n):
        s = input().split()
        if s[0] == '+':
            x += int(s[1])
        else:
            if x >= int(s[1]):
                x -= int(s[1])
            else:
                ans += 1
    print(x,ans)


def __starting_point():
    """sys.setrecursionlimit(400000)
    threading.stack_size(40960000)
    thread = threading.Thread(target=main)
    thread.start()"""
    main()
__starting_point()

n, x = list(map(int, input().split()))

bad = 0

for i in range(n):
	l = input().split()
	cmd, d = l
	d = int(d)
	if cmd == '+':
		x += d
	else:
		if x >= d:
			x -= d
		else:
			bad += 1

print(x, bad)


import sys


def main():
    x = sys.stdin.readline().split()
    n, x = int(x[0]), int(x[1])
    g=0
    for i in range(n):
        y = sys.stdin.readline().split()
        k = int(y[1])
        if y[0]=='-':
            if k>x:
                g+=1
            else:
                x-=k
        else:
            x+=k
    print(x,g)

main()


import sys
n,x=map(int,input().split())
sad=0
for i in range(n):
    a,b=map(str,input().split())
    b=int(b)
    if a=='+':
        x+=b
    else:
        if x>=b:
            x-=b
        else:
            sad+=1
print(x, sad)

n, x = list(map(int, input().split()))
sad = 0
for i in range(n):
    a, b = input().split()
    b = int(b)
    if a == '-':
        if x >= b:
            x -= b
        else:
            sad += 1
    else:
        x += b
print(x, sad)


n, x = list(map(int, input().split()))
bad = 0
for i in range(n):
    a, b = input().split()
    b = int(b)
    if a == '+':
        x += b
    else:
        if x >= b:
            x -= b
        else:
            bad += 1

print(x, bad)


n, x = map(int, input().split())
nb = 0
for _ in range(n):
    a, b = input().split()
    b = int(b)
    if a == '+':
        x += b
    else:
        if b <= x:
            x -= b
        else:
            nb += 1
print(x, nb)

n, x = list(map(int, input().split()))
sad = 0
for i in range(n):
    do, amount = input().split()
    if do == '+':
        x += int(amount)
    else:
        if x >= int(amount):
            x -= int(amount)
        else:
            sad += 1
print(x, sad)


n, x = list(map(int, input().split()))
distress = 0
for _ in range(n):
    c, amount = input().split()
    amount = int(amount)
    if c == '-':
        if amount <= x:
            x -= amount
        else:
            distress += 1
    else:
        x += amount
print(str(x) + " " + str(distress))


n, x = map(int, input().split())
cnt = 0
for i in range(n):
    sgn, v = input().split()
    v = int(v)
    if sgn == "+":
        x += v
    if sgn == "-":
        if x >= v:
            x -= v
        else:
            cnt += 1
print(x, cnt)

ans=0
n,x=list(map(int,input().split()))
for i in range(n):
    c,y=input().split()
    y=int(y)
    if c=="+": x+=y
    else:
        if x>=y: x-=y
        else: ans+=1
print(x,ans)


# n = int(input())
n, x = list(map(int, input().split()))

sad = 0
for _ in range(n):
    sign, number = input().split()
    number = int(number)
    if sign == '+':
        x += number
    else:
        if number <= x:
            x -= number
        else:
            sad += 1

print(x, sad)


import sys
n, x = [int(x) for x in sys.stdin.readline().split()]
bad = 0
for i in range(n):
    sym, num = sys.stdin.readline().split()
    if sym == "+":
        x += int(num)
    else:
        if x < int(num):
            bad += 1
        else:
            x -= int(num)
print(x, bad)


bad = 0
n,x = map(int,input().split())
for i in range(n):
    c,d = input().split()
    d = int(d)
    if c=="+": x+=d
    else:
        if d>x:
            bad+=1
        else:
            x-=d
print(x,bad)

inp = input()
inp = inp.split()
gr = 0
n = int(inp[0])
x = int(inp[1])
for i in range(n):
    inp = input()
    inp = inp.split()
    zn = inp[0]
    c = int(inp[1])
    if (zn == '+'):
        x += c
    else:
        if (x - c < 0):
            gr += 1
        else:
            x -= c
print(x, gr)


def main():
    n, cur = list(map(int, input().split()))
    frustr = 0
    for i in range(n):
        c, amo = input().split()
        amo = int(amo)
        if c == '+':
            cur += amo
        else:
            if cur >= amo:
                cur -= amo
            else:
                frustr += 1
    print(cur, frustr)



def __starting_point():
    main()

__starting_point()

n,x = map(int,input().split())
pres = x
dis = 0
for i in range(n):
    a,b = input().split()
    b = int(b)
    if(a=='+'):
        pres += b
    else:
        if(pres<b):
            dis += 1
        else:
            pres -= b
print(pres,dis)