qyliang/CodeNanoFix huggingface dataset:
Buggy code:
S=str(input())
count==0
for i in range(4):
  if S[i]=='+':
    count+=1
  else:
    count-=1
  i+=1
print(count)


Fixed code:
S=str(input())
count=0
i=0
for i in range(4):
  if S[i]=='+':
    count+=1
  else:
    count-=1
  i+=1
print(count)
Buggy code:
s = input()

ans = 0
for i in range(len(s)):
    if s[i] == "+":
        ans += 1ac
    else:
        ans -= 1

print(ans)


Fixed code:
s = input()

ans = 0
for i in range(len(s)):
    if s[i] == "+":
        ans += 1
    else:
        ans -= 1

print(ans)
Buggy code:
import sys

def main():
  input = sys.stdin.readline
  S = str(input().strip())
  ans = 0
  for c in S:
    if c == +:
      ans += 1
    else:
      ans -= 1
  print(ans)


if __name__ == '__main__':
  main()

Fixed code:
import sys

def main():
  input = sys.stdin.readline
  S = str(input().strip())
  ans = 0
  for c in S:
    if c == '+':
      ans += 1
    else:
      ans -= 1
  print(ans)


if __name__ == '__main__':
  main()
Buggy code:
s = input()
print(s.count("+")-s.count("+"))

Fixed code:
s = input().rstrip()
print(s.count('+') - s.count('-'))
Buggy code:
S = input()
ans = 0

for char in S:
    if char = "+":
        ans += 1
    else:
        ans -= 1

print(ans)

Fixed code:
S = input()
ans = 0

for char in S:
    if char == "+":
        ans += 1
    else:
        ans -= 1

print(ans)
Buggy code:
S = input()

n = 0

for i in S:
    if S[i] == '+':
        n += 1
    else:
        n -= 1

print(n)

Fixed code:
n = 0
S = input()
for i in range(len(S)):
    if S[i] == "+":
        n += 1
    else: n -= 1
print(n)
Buggy code:
s=list(input())
count =0
for i in range(len(s)):
  if s[i]="+":
    count +=1
  else:
    count -=1
print(count)

Fixed code:
s=list(input())
count =0
for i in range(len(s)):
  if s[i]=="+":
    count +=1
  else:
    count -=1
print(count)
Buggy code:
s = "----"
result = 0
for i in range(len(s)):
    a = s[i:i+1]
    print(a)
    if a == "+":
        result += 1
    else:
        result -= 1
print(result)

Fixed code:
s = input()
result = 0
for i in range(len(s)):
    a = s[i:i+1]
    if a == "+":
        result += 1
    else:
        result -= 1
print(result)
Buggy code:
li = list(input())

ans = 0

print (li)

for i in range(4) :
	if li[i] == '+' : 
		ans += 1
	else:
		ans -= 1

print(ans)

Fixed code:
S = list(input())
ans = 0
for i in range(4):
    if S[i] == "+":
        ans += 1
    else:
        ans -= 1
print(ans)
Buggy code:
s = input()
ans = 0
for x in s:
  if x == '+':
    ans++
  else:
    ans--
print(ans)

Fixed code:
s = input()
ans = 0
for x in s:
  if x == '+':
    ans+=1
  else:
    ans-=1
print(ans)
Buggy code:
s = input()
print(0+count.s("+")-count.s("-"))

Fixed code:
s = input()
print(0+s.count("+")-s.count("-"))
Buggy code:
S=list(input())
counter = 0
for i in range(len(S):
    if S[i] == '+':
        counter += 1
    else:
        counter -= 1

print(counter)

Fixed code:
S=list(input())
counter = 0
for i in range(len(S)):
    if S[i] == '+':
        counter += 1
    elif S[i] == '-':
        counter -= 1

print(counter)
Buggy code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

s = rr()
ans = 0
for i in s:
  ans += 1 if i == '+' else ans -= 1
print(ans)















Fixed code:
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))
inf = float('inf')
mod = 10**9 + 7

s = rr()
ans = 0
for i in s:
  if i == '+':
    ans += 1
  else:
    ans -= 1
print(ans)
Buggy code:
print(4 - 2 * input().count("c"))

Fixed code:
print(4 - 2 * input().count("-"))
Buggy code:
s = list(input())

count = int(s.count("+")) - int(s.count("-"))

print(1 + count)

Fixed code:
s = list(input())

count = int(s.count("+")) - int(s.count("-"))

print(count)
Buggy code:
S = input()
p = S.count('+')
m = s.count('-')
print(p-m)

Fixed code:
s = input()
p = s.count('+')
m = s.count('-')
print(p-m)
Buggy code:
a=input().split()
plus = a.count('+')
minus = a.count('-')
result=plus-minus
print(result)


Fixed code:
a=input()
plus = a.count('+')
minus = a.count('-')
result=plus-minus
print(result)
Buggy code:
S = list(input())

count = 1
for i in range(4):
  if S[i]=='+':
    count+=1

print(2*count-4)

Fixed code:
S = list(input())

count = 0
for i in range(4):
  if S[i]=='+':
    count+=1

print(2*count-4)
Buggy code:
S=list(input())
ans=0
if S[0]=='+':
    ans+=1
  else :
    ans-=1
if S[1]=='+':
    ans+=1
  else :
    ans-=1
if S[2]=='+':
    ans+=1
  else :
    ans-=1
if S[3]=='+':
    ans+=1
  else :
    ans-=1    
print(ans)    


Fixed code:
S=list(input())
ans=0
if S[0]=='+':
    ans+=1
else :
    ans-=1
if S[1]=='+':
    ans+=1
else :
    ans-=1
if S[2]=='+':
    ans+=1
else :
    ans-=1
if S[3]=='+':
    ans+=1
else :
    ans-=1    
print(ans)
Buggy code:
sum = 0
a = {'-':-1,'+':1}
s=input()
for i in len(s):
  sum+=a[s[i]]
print(sum)


Fixed code:
sum = 0
a = {'-':-1,'+':1}
s=input()
for i in range(len(s)):
  sum+=a[s[i]]
print(sum)
Buggy code:
op = input()
count = 0
for i in op:
  if(i == "-"):
    count-=1
  elif(i == "+"):
    count +=1

Fixed code:
op = input()
count = 0
for i in op:
  if(i == "-"):
    count-=1
  elif(i == "+"):
    count +=1
print(count)
Buggy code:
import sys
s = sys.stdin.readline()
assert len(s) <= 4
ans = 0
for i in range(len(s)):
    if s[i] == '+':
        ans += 1
    else:
        ans -= 1
print(ans)

Fixed code:
import sys
s = sys.stdin.readline()
assert len(s) == 5
ans = 0
for i in range(4):
    if s[i] == '+':
        ans += 1
    else:
        ans -= 1
print(ans)
Buggy code:
import sys
s = sys.stdin.readline()
ans = 0
for i in range(len(s)):
    if s[i] == '+':
        ans += 1
    else:
        ans -= 1
print(ans)

Fixed code:
import sys
s = sys.stdin.readline()
ans = 0
for i in range(4):
    if s[i] == '+':
        ans += 1
    else:
        ans -= 1
print(ans)
Buggy code:
s = list[input()]
ans = 0
for c in s:
  if c == '+':
    ans += 1
  else:
    ans -= 1
print(ans)

Fixed code:
s = list(input())
ans = 0
for c in s:
  if c == '+':
    ans += 1
  else:
    ans -= 1
print(ans)
Buggy code:
S = input()
num = 0
for i in range(len(S))
	if S[i] == '+':
    	num = num + 1
    else:
    	num = num - 1
print(num)

Fixed code:
S = input()
num = 0
for i in range(len(S)):
    if S[i] == '+': num = num + 1
    else : num = num -1
print(num)
Buggy code:
s=input()
c=0
for i in range(0,len(s)):
  if (s[i]=="+"):
    c=c+1
  else:
   c=c-1
print(C)
  

      

Fixed code:
s=input()
c=0
for i in range(0,len(s)):
  if (s[i]=="+"):
    c=c+1
  else:
   c=c-1
print(c)
Buggy code:
s = list(str(input()))
print(s.count("+")-s.count("-")-1)

Fixed code:
s = list(str(input()))
print(s.count("+")-s.count("-"))
Buggy code:
input(s)
ans = 0
for i in s:
    if i == "+":
        ans += 1
    else:
        ans-=1
print(ans)

Fixed code:
s = input()
ans = 0
for i in s:
    if i == "+":
        ans += 1
    else:
        ans-=1
print(ans)
Buggy code:
S = input()
#print(S)
#i = 0
for e in S:
    if e=="+":
        i=+1
    else:
        i-=1
print(i)


Fixed code:

S = input()
#print(S)
i = 0
for e in S:
    if e=="+":
        i=i+1
    if e=="-":
        i=i-1
print(i)
Buggy code:
s = input()

a = a.count('+')
b = a.count('-')

x = a - b

print(x)

Fixed code:
s = input()

a = s.count('+')
b = s.count('-')

x = a - b

print(x)
Buggy code:
s = input()

sum = 0
for i in s:
    if s == "+":
        sum += 1
    else:
        sum -= 1

print(sum)

Fixed code:
s = input()

sum = 0
for i in s:
    if i == "+":
        sum += 1
    else:
        sum -= 1

print(sum)
Buggy code:
 s = input()
 print(s.count('+')-s.count('-'))

Fixed code:
s=input()

print (s.count("+") - s.count("-"))
Buggy code:
s = input()
cnt = 0
for i in range(4):
  if s[i] == "+":
    cnt += 1
  elif s[i] == "-":
    cnt += 1
print(cnt)

Fixed code:
s = input()
cnt = 0
for i in range(4):
  if s[i] == "+":
    cnt += 1
  elif s[i] == "-":
    cnt -= 1
print(cnt)
Buggy code:
S = input()
s = list(S)
print(s)
ans = 0

for a in s:
    if a == '+':
        ans += 1
    if a == '-':
        ans -= 1
print(ans)

Fixed code:
S = input()
s = list(S)
ans = 0

for a in s:
    if a == '+':
        ans += 1
    if a == '-':
        ans -= 1
print(ans)
Buggy code:
c = 0
for s in input():
  if s = '+':c += 1
  else:c-= 1
print(c)

Fixed code:
c = 0
for s in input():
  if s == '+':c += 1
  else:c-= 1
print(c)
Buggy code:
s=list(input())
ans=0
for i in range(4):
    if s[i]=='+':
        ans+=1
    else:
        ans-=1

Fixed code:
s=input()
ans=0
for i in range(4):
  if s[i]=="+":
    ans+=1
  else:
    ans-=1
print(ans)
Buggy code:
h = input()
h = list()
hoge = 0
for i in h:
    if h == '+':
        hoge += 1
    else:
        hoge -= 1

print(hoge)

Fixed code:
h = input()
h = list(h)
hoge = 0
for i in h:
    if i == '+':
        hoge += 1
    else:
        hoge -= 1

print(hoge)
Buggy code:
char = input()

answer = 0
for i in range(len(char)):
  if(char[i] == '+'):
    answer += 0
  elif(char[i] == '-'):
    answer -= 0
print(answer)

Fixed code:
char = input()

answer = 0
for i in range(len(char)):
  if(char[i] == '+'):
    answer += 1
  elif(char[i] == '-'):
    answer -= 1
print(answer)
Buggy code:
s = sorted(input())
ans = 0
for i in s:
    if s[i] == '+':
        ans+=1
    else:
        ans -=1
print('ans')

Fixed code:
s = sorted(input())
ans = 0
for i in s:
    if i == '+':
        ans+=1
    else:
        ans -=1
print(ans)
Buggy code:
s = input()
num = 0
if s[0] == "+":
  num += 1
else:
  num -= 1

if s[1] == "+":
  num += 1
else:
  num -= 1

if s[2] == "+":
  num += 1
else:
  num -= 1

if s[3] == "+":
  num += 1
else:
  num -= 1


Fixed code:
s = input()
num = 0
if s[0] == "+":
  num += 1
else:
  num -= 1

if s[1] == "+":
  num += 1
else:
  num -= 1

if s[2] == "+":
  num += 1
else:
  num -= 1

if s[3] == "+":
  num += 1
else:
  num -= 1

print(num)
Buggy code:
s=input()
ans=0
for i in range(4):
    if s[i]=="+":
        ans+=1
    else:
        ans-=1


Fixed code:
s=input()
ans=0
for i in range(4):
    if s[i]=="+":
        ans+=1
    else:
        ans-=1
print(ans)
Buggy code:
S = input()
c = 0
for i in range(len(S)):
  if S[0] == "+":
    c += 1
  else:
    c -= 1
print(c)

Fixed code:
S = input()
c = 0
for i in range(4):
  if S[i]=="+":
    c += 1
  else:
    c -= 1
print(c)
Buggy code:
n = str(input())
num = []
from functools import reduce
num = [str(x) for x in list(str(n))]
x = o
for i in num:
  if i == "+":
    x = x + 1
  else:
    x = x - 1
print(x)

Fixed code:
n = str(input())
num = []
from functools import reduce
num = [str(x) for x in list(str(n))]
x = 0
for i in num:
  if i == "+":
    x = x + 1
  else:
    x = x - 1
print(x)
Buggy code:
input_str = int(input())
num = 0
for str in input_str:
    if str == '+':
        num += 1
    else:
        num -= 1
print(num)

Fixed code:
input_str = input()
num = 0
for str in input_str:
    if str == '+':
        num += 1
    else:
        num -= 1
print(num)
Buggy code:
s = input().rstrip()

num = 0

for c in s:
    if c == '+':
        num += 1
    if c == '+':
        num -= 1

print(num)


Fixed code:
s = input().rstrip()

num = 0

for c in s:
    if c == '+':
        num += 1
    if c == '-':
        num -= 1

print(num)
Buggy code:
val = 0
for s in list(input()):
  if(s == '+'):
    val++
  else:
    val--
print(val)

Fixed code:
val = 0
for s in list(input()):
  if(s == "+"):
    val+=1
  else:
    val-=1
print(val)
Buggy code:
s=input()
print(2*len([x for x in s if x=="+"]-len(s)
         )
     )

Fixed code:
s=input()
print(2*len([x for x in s if x=="+"])-len(s))
Buggy code:
S = int(input())
X = 0
for i in range(len(S)):
    if S[i] == "+":
        X += 1
    else:
        X -= 1

print(X)

Fixed code:
S = input()
X = 0
for i in range(len(S)):
    if S[i] == "+":
        X += 1
    else:
        X -= 1

print(X)
Buggy code:
s = input()
n = 0
for o in s:
    if o == '+':
        ans += 1
    else:
        ans -= 1
print(ans)

Fixed code:
s = input()
n = 0
ans = 0
for o in s:
    if o == '+':
        ans += 1
    else:
        ans -= 1
print(ans)
Buggy code:
ans = 1
S = list(input())
for s in S:
  if s == '+':
    ans += 1
  else:
    ans -= 1
print(ans)

Fixed code:
ans = 0
S = list(input())
for s in S:
  if s == '+':
    ans += 1
  else:
    ans -= 1
print(ans)
Buggy code:
s=input().split()
a=s.count('+')
print(2*a-4)

Fixed code:
s=input()
a=s.count('+')
print(2*a-4)
Buggy code:
s=input()
num=0
for i in s:
  if i=="-":
    num-=1
  else
    num+=1
print(num)

Fixed code:
s=input()
num=0
for i in s:
  if i=="-":
    num-=1
  else:
    num+=1
print(num)
Buggy code:
S=input()

j=0
for i in range(4):
 if S[i]=="+":
  j=j+1
 else
  j=j-1
print(j)

Fixed code:
S=input()
         
j=0
for i in range(4):
	if S[i]=="+":
		j=j+1
	else:
		j=j-1
print(j)
Buggy code:
a=input()
b=list(a)
c=0
for i in b:
  if b=='+':
    c+=1
  else:
    c+=-1
print(c)

Fixed code:
a=input()
b=list(a)
c=0
for i in b:
  if i=='+':
    c+=1
  else:
    c+=(-1)
print(c)
Buggy code:
def main(S):
    charlist = list(S)
    out = 0
    for c in charlist:
        if(c=='+'): 
            out = out + 1
        else:  
            out = out - 1
    print(out)
S = raw_input()
main(S)


Fixed code:
def main(S):
    charlist = list(S)
    out = 0
    for c in charlist:
        if(c=='+'): 
            out = out + 1
        else:  
            out = out - 1
    print(out)
S = input()
main(S)
Buggy code:
S = list(input())
print(S.count("+")-S.count("-")


Fixed code:
S = list(input())
print(S.count("+")-S.count("-"))
Buggy code:
if __name__ == "__main__":
    s = str(input())
    
    ans= 0
    
    for c in s:
        if c == '-':
            ans = ans - 1
        if c == '+'
            ans == ans + 1
            
    print(ans)

Fixed code:
if __name__ == "__main__":
    s = str(input())

    ans= 0

    for c in s:
        if c == '-':
            ans = ans - 1
        if c == '+':
            ans = ans + 1

    print(ans)
Buggy code:
S = input()
a = S.count("+")
s = S.count("-")
print(4+a-s)

Fixed code:
S = input()
a = S.count("+")
s = S.count("-")
print(a-s)
Buggy code:
s=str(input())
count=0
for i in range(s):
  if s[i]=='+':
    count+=1;
  else:
    count-=1
print(count)


Fixed code:
s=str(input())
count=0
for i in range(4):
  if s[i]=='+':
    count+=1;
  else:
    count-=1
print(count)
Buggy code:
S= int(input())
A=S.count('+')
B=S.count('-')
print(A-B)

Fixed code:
S= input()
A=S.count('+')
B=S.count('-')
print(A-B)
Buggy code:
a=list(input())
sum=0
for i in range(len(a)):
  sum+=1 if a[i]=="+" else sum-=1
print(sum)

Fixed code:
a=list(input())
sum=0
for i in range(len(a)):
  sum+=1 if a[i]=="+" else -1
print(sum)
Buggy code:
S = input()
print(S.count('+')-S.count'-')


Fixed code:
S = list(input())

print (S.count('+') - S.count('-'))
Buggy code:
a=str(input())
print(a.cpunt("+")-a.count("-"))

Fixed code:
a=str(input())
print(a.count("+")-a.count("-"))
Buggy code:
s=input()
print(s.count('+')-s.sount('-'))

Fixed code:
s=input()

print(s.count('+')-s.count('-'))
Buggy code:
import sys
 
n = 0

S = input()

for i in range(1,5):
    if S[i]=="+": n+=1
    else: n-=1
 
print(n)

Fixed code:
import sys
 
n = 0
 
S = input()

for i in range(0,4):
    if S[i]=="+": n+=1
    else: n-=1
 
print(n)
Buggy code:
S = input()
ans = 0
for i in range(4):
  if S[i] == "+":
    ans += 1
   else:
    ans -= 1

print(ans)

Fixed code:
S = input()
ans = 0
for i in range(4):
  if S[i] == "+":
    ans += 1
  else:
    ans -= 1
print(ans)
Buggy code:
S = input()
print(S.count('+')-s.count('-'))

Fixed code:
s = input()
print (s.count("+") - s.count("-"))
Buggy code:
s = input()
c = 0
for i in s:
    if i == +:
        c += 1
    else:
        c -= 1
print(c)

Fixed code:
s = input()
c = 0
for i in s:
    if i == "+":
        c += 1
    else:
        c -= 1
print(c)
Buggy code:
s = input()
count = 0
for i in range(4):
  if s[i] == +:
    count += 1
  else:
    count -=1
print(count)

Fixed code:
s = input()
count = 0
for i in range(4):
  if s[i] == "+":
    count += 1
  else:
    count -=1
print(count)
Buggy code:
S = str(input())
p = S.count('+') 
m = S.sount('-')
print(p-m)

Fixed code:
S = str(input())
p = S.count('+') 
m = S.count('-')
print(p-m)
Buggy code:
s = input()

plus = s.count('-')
minus = s.count('+')

print(plus - minus)

Fixed code:
s = input()

plus = s.count('+')
minus = s.count('-')

print(plus - minus)
Buggy code:
a=0
s=input()
for i in s:
    if s[i]=='-':
        a-=1
    else:
        a+=1
print(a)

Fixed code:
a=0
s=input()
for i in range(4):
    if s[i]=="-":
        a-=1
    else:
        a+=1
print(a)
Buggy code:
s = input()
a = 0
for x in s:
    if x == '+'
        a += 1
    else:
        a -= 1

print(a)            


Fixed code:
s = input()
a = 0
for x in s:
    if x == '+':
        a += 1
    else:
        a -= 1

print(a)
Buggy code:
#coding:utf-8
s = input()
a = 0
for c in s:
  a = a + 1 if c = "+" else a = a - 1
print(a)

Fixed code:
#coding:utf-8
s = input()
a = 0
for c in s:
  a = a + 1 if c == "+" else a - 1
print(a)
Buggy code:
x = input()
print(x.count('+') - count('-'))

Fixed code:
x = input()
print(x.count('+') - x.count('-'))
Buggy code:
print(4-input().count()*2)

Fixed code:
print(4-input().count("-")*2)
Buggy code:
from collections import Counter
from sys import stdin
s=Counter(list(stdin.readline().rstrip()))
print(s['+']+s['-'])

Fixed code:
from collections import Counter
from sys import stdin
s=Counter(list(stdin.readline().rstrip()))
print(s['+']*1+s['-']*-1)
Buggy code:
n = str(input())

x = 0

for i in range(3):
  if n[i] == "+":
    x = x + 1
  else:
    x = x - 1
    
print(x)



Fixed code:
n = str(input())

x = 0

for i in range(4):
  if n[i] == "+":
    x = x + 1
  else:
    x = x - 1
    
print(x)
Buggy code:
a = input
print(a.count('+') - a.count('-'))

Fixed code:
a = input()
print(a.count('+') - a.count('-'))
Buggy code:
s=input()
ans=0
for i in range(4):
  if s[i]='+':
    ans += 1
  else:
    ans -= 1
print(ans)

Fixed code:
S=input()
ans = 0
for i in range(4):
  if S[i]=='+':
    ans += 1
  else:
    ans -= 1
print(ans)
Buggy code:
N = input()
count = 0
for i in range(len(N)):
      if N[i] == "+":
            count = count +1
      if N[i] == "-":
            count = count - 1

Fixed code:
N = input()
count = 0
for i in range(len(N)):
      if N[i] == "+":
            count = count +1
      if N[i] == "-":
            count = count - 1
print(count)
Buggy code:
S = list(input())
ans = 0
print(S)
for str in S:
    if str == '+':
        ans = ans +1
    else:
        ans = ans - 1
print(ans)


Fixed code:
S = list(input())
ans = 0
for str in S:
    if str == '+':
        ans = ans +1
    else:
        ans = ans - 1
print(ans)
Buggy code:
s=input()
count=0
for i in s:
    if i='+':
        count+=1
    else:
        count-=1

Fixed code:
s=input()
count=0
for i in s:
    if i=='+':
        count+=1
    else:
        count-=1
print(count)
Buggy code:
s=str(input())
ans=-4
for i in range(4):
  if s[i]='+':
    ans+=2
input(ans)

Fixed code:
s=str(input())
ans=-4
for i in range(4):
    if s[i]=='+':
        ans+=2
print(ans)
Buggy code:
s=input()
con=[0]*2
for i in range(4):
    if s[i]=='+':
        c[0]+=1
     else:
         c[1]+=1
print(c[0]-c[1])           

Fixed code:
s=input()
con=[0]*2
for i in range(4):
    if s[i]=='+':
        con[0]+=1
    else:
        con[1]+=1
print(con[0]-con[1])
Buggy code:
S = list(input())
ans = 0
for i in S:
    if i == '+':
        ans += 1
    else:
        ans -= 1 

Fixed code:
S = list(input())
ans = 0

for i in S:
    if i == '+':
        ans += 1
    else:
        ans -= 1 
print(ans)
Buggy code:
s=list(input())
ans=0
for i in s:
  if i="-":
    ans=ans-1
  else:
    ans=ans+1
print(ans)

Fixed code:
s=list(input())
ans=0
for i in s:
  if i=="-":
    ans=ans-1
  else:
    ans=ans+1
print(ans)
Buggy code:
S=input()
a=0
for i in S:
  if i==='+':
    a+=1
  else:
    a-=1
print(a)
    

Fixed code:
S=input()
a=0
for i in S:
  if i=='+':
    a+=1
  else:
    a-=1
print(a)
Buggy code:
cs =list(input())
lp = len([c for c in cs if c=='+'])
lm = len([c for c in cs if c=='+'])
print(lp-lm)

Fixed code:
cs =list(input())
lp = len([c for c in cs if c=='+'])
lm = len([c for c in cs if c=='-'])
print(lp-lm)
Buggy code:
s = input()
ans = 0
for i in range(4):
    if s[i] == '+':
        ans += 1
    elif s[i] == '-':
        ans -= 1

Fixed code:
s = input()
ans = 0
for i in range(4):
    if s[i] == '+':
        ans += 1
    elif s[i] == '-':
        ans -= 1

print(ans)
Buggy code:
s = input()
output = 0
for o in s:
    if o == '+':
        output += 1
    else if o == '-':
        output -= 1
    else:
        pass
print(output)

Fixed code:
s = input()
output = 0
for o in s:
    if o == '+':
        output += 1
    elif o == '-':
        output -= 1
    else:
        pass
print(output)
Buggy code:
a=input()

b=(a.count('+'))
print (b)

n=-4+b*2

print (n)

Fixed code:
a=input()

b=(a.count('+'))

n=-4+b*2

print (n)
Buggy code:
S = input()
S = list(S)


S = [int(1) if '+' else int(-1) for x in S]

print(sum(S))

Fixed code:
S = input()
S = list(S)


S = [int(1) if x == '+' else int(-1) for x in S]

print(sum(S))
Buggy code:
S=input()
print(S.count("+")-S.count("-")

Fixed code:
S=input()
print(S.count("+")-S.count("-"))
Buggy code:
s=input()
a=0
for i in s:
    if i=="+":
        a+=1
    else:
        a-=1
print(s)

Fixed code:
a=0
for i in input():
    if i == '+':
        a += 1
    else:
        a -= 1
print(a)
Buggy code:
ans = 1
for i in input():
    if i == '+':
        ans += 1
    else:
        ans -= 1
print(ans)

Fixed code:
ans = 0
for i in input():
    if i == '+':
        ans += 1
    else:
        ans -= 1
print(ans)
Buggy code:
S = str(input())
list = lisr(S)
num = list.count('+')
print('num - (4-num)')

Fixed code:
S = str(input())
list = list(S)
num = list.count('+')
print(num - (4-num))
Buggy code:
s=int(input())
ans=0
for i in range(4):
  if s[i]=='+':
    ans+=1
  else:
    ans-=1
print(ans)

Fixed code:
s = input()
ans = 0
for i in range(4):
  if s[i] == "+":
    ans += 1
  else:
    ans -= 1
print(ans)
Buggy code:
S=list(input())
count=0
for s in S:
    if s=='+':
        count=+1
    if s=='-':
        count=-1


print(count)

Fixed code:
S=list(input())
count=0
for s in S:
    if s=='+':
        count=count+1
    if s=='-':
        count=count-1


print(count)
Buggy code:
s = input()
cnt = 0
 
for i in s:
  if i = '+':
    cnt = cnt +1
  elif i = '-':
    cnt = cnt-1
 
print(cnt)

Fixed code:
s = input()
cnt = 0
 
for i in s:
  if i == '+':
    cnt = cnt +1
  elif i == '-':
    cnt = cnt-1
 
print(cnt)
Buggy code:
S = list(input())
a = list.count('+')
b = list.count('-')
print(int(a) - int(b))


Fixed code:
S = list(input())
a = S.count('+')
b = S.count('-')
print(int(a) - int(b))
Buggy code:
S=input()
if S.count('+') = 0:
 print(-4)
elif S.count('+') = 1:
 print(-2)
elif S.count('+') = 2:
 print(0)
elif S.count('+') = 3:
 print(2)
else:
 print(4)

Fixed code:
S=input()
if S.count('+') == 0:
 print(-4)
elif S.count('+') == 1:
 print(-2)
elif S.count('+') == 2:
 print(0)
elif S.count('+') == 3:
 print(2)
else:
 print(4)
Buggy code:
s=input()
p=0; m=0
for i in range(0,len(s))
  if s[i]='+':
    p += 1
  else:
    m += 1
print(p-m)

Fixed code:
s=input()
p=0; m=0
for i in range(0,4):
  if s[i]=='+':
    p += 1
  else:
    m += 1
print(p-m)
Buggy code:
n = input()
plus = n.count('+')
minus = n.count('-')
print(plus_minus)

Fixed code:
n = input()
plus = n.count('+')
minus = n.count('-')
print(plus-minus)
Buggy code:
s = list(input())

ans = 0
for i in s:
  if i == "+":
    ans += 1
  else:
    ans == 1
    
print(ans)

Fixed code:
s = list(input())

ans = 0
for i in s:
  if i == "+":
    ans += 1
  else:
    ans -= 1
    
print(ans)