-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path2941.py
44 lines (34 loc) · 882 Bytes
/
2941.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
from re import S
string = input()
count = 0
list(string)
i = 0
while i < len(string):
if i == len(string) - 1:
count += 1
break
if string[i] == 'c':
if string[i+1] == '-':
i += 1
elif string[i+1] == '=':
i += 1
count += 1
elif string[i] == 'd':
if i+2 < len(string):
if string[i+1] == 'z' and string[i+2] == '=':
i += 2
elif string[i+1] == '-':
i += 1
elif string[i+1] == '-':
i += 1
count += 1
elif (string[i] == 'l' or string[i] == 'n') and string[i+1] == 'j':
i += 1
count += 1
elif (string[i] == 's' or string[i] == 'z') and string[i+1] == '=':
i += 1
count += 1
else:
count += 1
i += 1
print(count)