Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- a = int(input())
- qw = list(input())
- maxx = 0
- kolvo = 0
- skob = 0
- l = 0
- err = 0
- slov = 0
- for i in range(a):
- if qw[i] == '_':
- if skob == 1:
- maxx = max(maxx,i-l)
- l = i+1
- continue
- if qw[i] == '(':
- skob = 1
- l = i + 1
- continue
- if qw[i] == ')':
- skob = 0
- l = i + 1
- kolvo += slov + 1
- slov = 0
- if skob == 1:
- maxx = max(maxx,i-l)
- continue
- print(maxx,kolvo)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement