node_ids
sequencelengths
4
1.4k
edge_index
sequencelengths
1
2.22k
text
sequencelengths
4
1.4k
source
stringlengths
14
427k
[ 7, 0, 13, 4, 13, 4, 13, 0, 13, 4, 13, 13, 13, 4, 18, 13, 13, 17, 4, 13, 2, 2, 13, 17, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13 ]
[ [ 29, 2 ], [ 32, 8 ], [ 30, 11 ], [ 26, 12 ], [ 30, 15 ], [ 33, 22 ], [ 27, 24 ], [ 26, 27 ], [ 29, 30 ], [ 32, 33 ] ]
[ "s = str(input())\nn, p = len(s), s.count('p')\n\nprint(n // 2 - p)", "s = str(input())", "s", "str(input())", "str", "input()", "input", "n, p = len(s), s.count('p')", "n", "len(s)", "len", "s", "p", "s.count('p')", "s.count", "s", "count", "'p'", "print(n // 2 - p)", "print", "n // 2 - p", "n // 2", "n", "2", "p", "p = len(s), s.count('p')", "s.count('p')", "p", "s = str(input())", "str(input())", "s", "n, p = len(s), s.count('p')", "len(s)", "n" ]
s = str(input()) n, p = len(s), s.count('p') print(n // 2 - p)
[ 7, 15, 0, 13, 4, 18, 4, 18, 13, 13, 13, 0, 13, 4, 13, 13, 14, 2, 2, 13, 17, 17, 0, 13, 2, 17, 2, 13, 17, 0, 13, 2, 2, 17, 2, 13, 17, 17, 0, 13, 17, 28, 13, 13, 4, 13, 13, 13, 14, 2, 2, 13, 17, 2, 13, 17, 0, 13, 17, 14, 2, 2, 13, 17, 2, 13, 17, 0, 13, 17, 4, 13, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13, 10, 17, 13, 10, 2, 13, 10, 2, 13, 10, 4, 13 ]
[ [ 77, 3 ], [ 92, 12 ], [ 78, 15 ], [ 93, 19 ], [ 86, 23 ], [ 93, 27 ], [ 89, 30 ], [ 93, 35 ], [ 80, 39 ], [ 78, 46 ], [ 90, 47 ], [ 87, 47 ], [ 83, 57 ], [ 74, 68 ], [ 75, 72 ], [ 84, 72 ], [ 81, 72 ], [ 74, 75 ], [ 77, 78 ], [ 80, 81 ], [ 83, 84 ], [ 86, 87 ], [ 89, 90 ], [ 92, 93 ] ]
[ "from sys import stdin\nS = stdin.readline().rstrip()\nlen_S = len(S)\nif len_S % 2 == 0:\n atcodeer = \"gp\"*(len_S//2)\nelse:\n atcodeer = \"gp\"*(len_S//2)+\"g\"\n\nans = 0\nfor s1, s2 in zip(S, atcodeer):\n if s1 == 'g' and s2 == 'p':\n ans += 1\n elif s2 == 'g' and s1 == 'p':\n ans -= 1\nprint(ans)", "from sys import stdin", "S = stdin.readline().rstrip()", "S", "stdin.readline().rstrip()", "stdin.readline().rstrip", "stdin.readline()", "stdin.readline", "stdin", "readline", "rstrip", "len_S = len(S)", "len_S", "len(S)", "len", "S", "if len_S % 2 == 0:\n atcodeer = \"gp\"*(len_S//2)\nelse:\n atcodeer = \"gp\"*(len_S//2)+\"g\"", "len_S % 2 == 0", "len_S % 2", "len_S", "2", "0", "atcodeer = \"gp\"*(len_S//2)", "atcodeer", "\"gp\"*(len_S//2)", "\"gp\"", "len_S//2", "len_S", "2", "atcodeer = \"gp\"*(len_S//2)+\"g\"", "atcodeer", "\"gp\"*(len_S//2)+\"g\"", "\"gp\"*(len_S//2)", "\"gp\"", "len_S//2", "len_S", "2", "\"g\"", "ans = 0", "ans", "0", "for s1, s2 in zip(S, atcodeer):\n if s1 == 'g' and s2 == 'p':\n ans += 1\n elif s2 == 'g' and s1 == 'p':\n ans -= 1", "s1", "s2", "zip(S, atcodeer)", "zip", "S", "atcodeer", "if s1 == 'g' and s2 == 'p':\n ans += 1\n elif s2 == 'g' and s1 == 'p':\n ans -= 1", "s1 == 'g' and s2 == 'p'", "s1 == 'g'", "s1", "'g'", "s2 == 'p'", "s2", "'p'", "ans += 1", "ans", "1", "elif s2 == 'g' and s1 == 'p':\n ans -= 1", "s2 == 'g' and s1 == 'p'", "s2 == 'g'", "s2", "'g'", "s1 == 'p'", "s1", "'p'", "ans -= 1", "ans", "1", "print(ans)", "print", "ans", "ans -= 1", "1", "ans", "S = stdin.readline().rstrip()", "stdin.readline().rstrip()", "S", "ans = 0", "0", "ans", "ans += 1", "1", "ans", "atcodeer = \"gp\"*(len_S//2)", "\"gp\"*(len_S//2)", "atcodeer", "atcodeer = \"gp\"*(len_S//2)+\"g\"", "\"gp\"*(len_S//2)+\"g\"", "atcodeer", "len_S = len(S)", "len(S)", "len_S" ]
from sys import stdin S = stdin.readline().rstrip() len_S = len(S) if len_S % 2 == 0: atcodeer = "gp"*(len_S//2) else: atcodeer = "gp"*(len_S//2)+"g" ans = 0 for s1, s2 in zip(S, atcodeer): if s1 == 'g' and s2 == 'p': ans += 1 elif s2 == 'g' and s1 == 'p': ans -= 1 print(ans)
[ 7, 0, 13, 4, 13, 0, 13, 17, 0, 13, 17, 28, 13, 13, 14, 2, 13, 17, 0, 13, 17, 14, 2, 13, 17, 0, 13, 17, 0, 13, 17, 14, 2, 13, 17, 0, 13, 17, 4, 13, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13 ]
[ [ 57, 2 ], [ 45, 6 ], [ 42, 9 ], [ 13, 12 ], [ 58, 12 ], [ 43, 16 ], [ 55, 16 ], [ 52, 16 ], [ 54, 19 ], [ 12, 23 ], [ 48, 26 ], [ 51, 29 ], [ 12, 33 ], [ 60, 36 ], [ 61, 40 ], [ 49, 40 ], [ 46, 40 ], [ 42, 43 ], [ 45, 46 ], [ 48, 49 ], [ 51, 52 ], [ 54, 55 ], [ 57, 58 ], [ 60, 61 ] ]
[ "s=input()\n\nans=0\ng=0\nfor h in s:\n if g>0:\n #pを出せるなら出す\n g-=1\n if h=='g':\n ans+=1\n else:\n #pが出せないならg\n g+=1\n if h=='p':\n ans-=1\n\nprint(ans)", "s=input()", "s", "input()", "input", "ans=0", "ans", "0", "g=0", "g", "0", "for h in s:\n if g>0:\n #pを出せるなら出す\n g-=1\n if h=='g':\n ans+=1\n else:\n #pが出せないならg\n g+=1\n if h=='p':\n ans-=1", "h", "s", "if g>0:\n #pを出せるなら出す\n g-=1\n if h=='g':\n ans+=1\n else:\n #pが出せないならg\n g+=1\n if h=='p':\n ans-=1", "g>0", "g", "0", "g-=1", "g", "1", "if h=='g':\n ans+=1\n ", "h=='g'", "h", "'g'", "ans+=1", "ans", "1", "g+=1", "g", "1", "if h=='p':\n ans-=1", "h=='p'", "h", "'p'", "ans-=1", "ans", "1", "print(ans)", "print", "ans", "g=0", "0", "g", "ans=0", "0", "ans", "ans+=1", "1", "ans", "g+=1", "1", "g", "g-=1", "1", "g", "s=input()", "input()", "s", "ans-=1", "1", "ans" ]
s=input() ans=0 g=0 for h in s: if g>0: #pを出せるなら出す g-=1 if h=='g': ans+=1 else: #pが出せないならg g+=1 if h=='p': ans-=1 print(ans)
[ 7, 12, 13, 29, 4, 13, 4, 13, 13, 4, 18, 4, 13, 13, 0, 13, 4, 13, 0, 13, 17, 0, 13, 17, 0, 13, 17, 28, 13, 13, 14, 2, 13, 13, 0, 13, 17, 14, 2, 13, 17, 14, 2, 13, 17, 0, 13, 17, 0, 13, 17, 14, 2, 13, 17, 0, 13, 17, 14, 2, 13, 17, 4, 13, 13, 10, 4, 13, 10, 17, 13, 10, 17, 13, 10, 12, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13 ]
[ [ 66, 15 ], [ 87, 19 ], [ 72, 22 ], [ 78, 25 ], [ 29, 28 ], [ 67, 28 ], [ 73, 32 ], [ 91, 32 ], [ 79, 33 ], [ 70, 33 ], [ 90, 35 ], [ 28, 39 ], [ 28, 43 ], [ 84, 46 ], [ 69, 49 ], [ 28, 53 ], [ 81, 56 ], [ 28, 60 ], [ 82, 64 ], [ 85, 64 ], [ 88, 64 ], [ 66, 67 ], [ 69, 70 ], [ 72, 73 ], [ 78, 79 ], [ 81, 82 ], [ 84, 85 ], [ 87, 88 ], [ 90, 91 ] ]
[ "\ndef inpl():\n return list(map(int, input().split()))\n\n\nS = input()\n\nans = 0\ng = 0\np = 0\nfor s in S:\n if g == p:\n g += 1\n if s == \"g\":\n pass\n elif s == \"p\":\n ans -= 1\n else:\n p += 1\n if s == \"g\":\n ans += 1\n elif s == \"p\":\n pass\nprint(ans)", "def inpl():\n return list(map(int, input().split()))", "inpl", "return list(map(int, input().split()))", "list(map(int, input().split()))", "list", "map(int, input().split())", "map", "int", "input().split()", "().split", "()", "input", "split", "S = input()", "S", "input()", "input", "ans = 0", "ans", "0", "g = 0", "g", "0", "p = 0", "p", "0", "for s in S:\n if g == p:\n g += 1\n if s == \"g\":\n pass\n elif s == \"p\":\n ans -= 1\n else:\n p += 1\n if s == \"g\":\n ans += 1\n elif s == \"p\":\n pass", "s", "S", "if g == p:\n g += 1\n if s == \"g\":\n pass\n elif s == \"p\":\n ans -= 1\n else:\n p += 1\n if s == \"g\":\n ans += 1\n elif s == \"p\":\n pass", "g == p", "g", "p", "g += 1", "g", "1", "if s == \"g\":\n pass\n elif s == \"p\":\n ans -= 1\n ", "s == \"g\"", "s", "\"g\"", "elif s == \"p\":\n ans -= 1\n ", "s == \"p\"", "s", "\"p\"", "ans -= 1", "ans", "1", "p += 1", "p", "1", "if s == \"g\":\n ans += 1\n elif s == \"p\":\n pass", "s == \"g\"", "s", "\"g\"", "ans += 1", "ans", "1", "elif s == \"p\":\n pass", "s == \"p\"", "s", "\"p\"", "print(ans)", "print", "ans", "S = input()", "input()", "S", "p += 1", "1", "p", "g = 0", "0", "g", "def inpl():\n return list(map(int, input().split()))", "def inpl():\n return list(map(int, input().split()))", "inpl", "p = 0", "0", "p", "ans += 1", "1", "ans", "ans -= 1", "1", "ans", "ans = 0", "0", "ans", "g += 1", "1", "g" ]
def inpl(): return list(map(int, input().split())) S = input() ans = 0 g = 0 p = 0 for s in S: if g == p: g += 1 if s == "g": pass elif s == "p": ans -= 1 else: p += 1 if s == "g": ans += 1 elif s == "p": pass print(ans)
[ 7, 0, 13, 4, 13, 0, 13, 39, 28, 13, 4, 13, 4, 13, 13, 14, 2, 18, 13, 13, 17, 4, 18, 13, 13, 17, 4, 18, 13, 13, 17, 0, 13, 17, 28, 13, 4, 13, 4, 13, 13, 0, 13, 2, 2, 13, 17, 18, 13, 13, 4, 13, 13, 10, 39, 13, 10, 2, 13, 10, 4, 13, 10, 17, 13 ]
[ [ 60, 2 ], [ 54, 6 ], [ 10, 9 ], [ 61, 14 ], [ 61, 18 ], [ 9, 19 ], [ 55, 23 ], [ 55, 28 ], [ 63, 32 ], [ 36, 35 ], [ 61, 40 ], [ 57, 42 ], [ 35, 45 ], [ 55, 48 ], [ 35, 49 ], [ 58, 52 ], [ 64, 52 ], [ 54, 55 ], [ 57, 58 ], [ 60, 61 ], [ 63, 64 ] ]
[ "s = input()\nlis = []\nfor i in range(len(s)):\n if s[i] == 'g':\n lis.append(0)\n else:\n lis.append(1)\nans = 0\nfor i in range(len(s)):\n ans += i%2 - lis[i]\nprint(ans)", "s = input()", "s", "input()", "input", "lis = []", "lis", "[]", "for i in range(len(s)):\n if s[i] == 'g':\n lis.append(0)\n else:\n lis.append(1)", "i", "range(len(s))", "range", "len(s)", "len", "s", "if s[i] == 'g':\n lis.append(0)\n else:\n lis.append(1)", "s[i] == 'g'", "s[i]", "s", "i", "'g'", "lis.append(0)", "lis.append", "lis", "append", "0", "lis.append(1)", "lis.append", "lis", "append", "1", "ans = 0", "ans", "0", "for i in range(len(s)):\n ans += i%2 - lis[i]", "i", "range(len(s))", "range", "len(s)", "len", "s", "ans += i%2 - lis[i]", "ans", "i%2 - lis[i]", "i%2", "i", "2", "lis[i]", "lis", "i", "print(ans)", "print", "ans", "lis = []", "[]", "lis", "ans += i%2 - lis[i]", "i%2 - lis[i]", "ans", "s = input()", "input()", "s", "ans = 0", "0", "ans" ]
s = input() lis = [] for i in range(len(s)): if s[i] == 'g': lis.append(0) else: lis.append(1) ans = 0 for i in range(len(s)): ans += i%2 - lis[i] print(ans)
[ 7, 0, 13, 4, 13, 0, 13, 4, 13, 13, 0, 13, 4, 18, 13, 13, 17, 4, 13, 2, 2, 13, 17, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13 ]
[ [ 25, 2 ], [ 31, 6 ], [ 26, 9 ], [ 28, 11 ], [ 26, 14 ], [ 32, 21 ], [ 29, 23 ], [ 25, 26 ], [ 28, 29 ], [ 31, 32 ] ]
[ "s = input()\nn = len(s)\npt = s.count(\"p\")\nprint(n //2 -pt)", "s = input()", "s", "input()", "input", "n = len(s)", "n", "len(s)", "len", "s", "pt = s.count(\"p\")", "pt", "s.count(\"p\")", "s.count", "s", "count", "\"p\"", "print(n //2 -pt)", "print", "n //2 -pt", "n //2", "n", "2", "pt", "s = input()", "input()", "s", "pt = s.count(\"p\")", "s.count(\"p\")", "pt", "n = len(s)", "len(s)", "n" ]
s = input() n = len(s) pt = s.count("p") print(n //2 -pt)
[ 7, 15, 13, 0, 13, 4, 13, 4, 13, 0, 13, 4, 18, 13, 13, 13, 0, 13, 2, 2, 18, 13, 17, 18, 13, 17, 17, 4, 13, 13, 10, 2, 13, 10, 4, 13, 10, 4, 13 ]
[ [ 34, 4 ], [ 37, 10 ], [ 35, 15 ], [ 31, 17 ], [ 38, 21 ], [ 38, 24 ], [ 32, 29 ], [ 31, 32 ], [ 34, 35 ], [ 37, 38 ] ]
[ "import collections\nS=list(input())\n_S=collections.Counter(S)\ncount=(_S[\"g\"]-_S[\"p\"])//2\nprint(count)", "import collections", "collections", "S=list(input())", "S", "list(input())", "list", "input()", "input", "_S=collections.Counter(S)", "_S", "collections.Counter(S)", "collections.Counter", "collections", "Counter", "S", "count=(_S[\"g\"]-_S[\"p\"])//2", "count", "(_S[\"g\"]-_S[\"p\"])//2", "_S[\"g\"]-_S[\"p\"]", "_S[\"g\"]", "_S", "\"g\"", "_S[\"p\"]", "_S", "\"p\"", "2", "print(count)", "print", "count", "count=(_S[\"g\"]-_S[\"p\"])//2", "(_S[\"g\"]-_S[\"p\"])//2", "count", "S=list(input())", "list(input())", "S", "_S=collections.Counter(S)", "collections.Counter(S)", "_S" ]
import collections S=list(input()) _S=collections.Counter(S) count=(_S["g"]-_S["p"])//2 print(count)
[ 7, 15, 13, 15, 13, 15, 4, 18, 13, 13, 2, 17, 17, 12, 13, 29, 18, 4, 18, 18, 13, 13, 13, 39, 17, 0, 13, 2, 2, 17, 17, 17, 12, 13, 12, 13, 12, 13, 14, 40, 13, 17, 41, 28, 13, 4, 13, 13, 4, 39, 29, 13, 14, 2, 13, 17, 41, 28, 13, 4, 13, 13, 4, 4, 13, 29, 13, 41, 28, 13, 4, 13, 13, 4, 4, 13, 0, 13, 13, 29, 4, 13, 13, 4, 13, 31, 13, 23, 13, 23, 13, 0, 13, 4, 13, 4, 13, 0, 13, 17, 28, 13, 13, 4, 13, 13, 14, 2, 2, 13, 17, 17, 14, 2, 13, 17, 0, 13, 17, 14, 2, 13, 17, 0, 13, 17, 4, 13, 13, 10, 12, 13, 10, 12, 13, 10, 2, 13, 10, 4, 13, 10, 12, 13, 10, 12, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13 ]
[ [ 136, 26 ], [ 88, 40 ], [ 45, 44 ], [ 90, 47 ], [ 90, 54 ], [ 59, 58 ], [ 88, 61 ], [ 131, 64 ], [ 70, 69 ], [ 88, 72 ], [ 134, 75 ], [ 78, 77 ], [ 77, 86 ], [ 88, 88 ], [ 90, 90 ], [ 139, 92 ], [ 146, 96 ], [ 151, 98 ], [ 140, 105 ], [ 148, 117 ], [ 154, 124 ], [ 155, 128 ], [ 149, 128 ], [ 152, 128 ], [ 136, 137 ], [ 139, 140 ], [ 148, 149 ], [ 151, 152 ], [ 154, 155 ] ]
[ "import sys\nimport math\nfrom collections import defaultdict\n\nsys.setrecursionlimit(10**7)\ndef input():\n return sys.stdin.readline()[:-1]\n\nmod = 10**9 + 7\n\ndef I(): return int(input())\ndef LI(): return list(map(int, input().split()))\ndef LIR(row,col):\n if row <= 0:\n return [[] for _ in range(col)]\n elif col == 1:\n return [I() for _ in range(row)]\n else:\n read_all = [LI() for _ in range(row)]\n return map(list, zip(*read_all))\n\n#################\n\nS = str(input())\n\nans = 0\nfor i,s in enumerate(S):\n if i%2 == 0:\n if s == 'p':\n ans -= 1\n else:\n if s == 'g':\n ans += 1\n\nprint(ans)", "import sys", "sys", "import math", "math", "from collections import defaultdict", "sys.setrecursionlimit(10**7)", "sys.setrecursionlimit", "sys", "setrecursionlimit", "10**7", "10", "7", "def input():\n return sys.stdin.readline()[:-1]", "input", "return sys.stdin.readline()[:-1]", "sys.stdin.readline()[:-1]", "sys.stdin.readline()", "sys.stdin.readline", "sys.stdin", "sys", "stdin", "readline", ":-1", "-1", "mod = 10**9 + 7", "mod", "10**9 + 7", "10**9", "10", "9", "7", "def I(): return int(input())", "I", "def LI(): return list(map(int, input().split()))", "LI", "def LIR(row,col):\n if row <= 0:\n return [[] for _ in range(col)]\n elif col == 1:\n return [I() for _ in range(row)]\n else:\n read_all = [LI() for _ in range(row)]\n return map(list, zip(*read_all))\n\n#################", "LIR", "if row <= 0:\n return [[] for _ in range(col)]\n elif col == 1:\n return [I() for _ in range(row)]\n else:\n read_all = [LI() for _ in range(row)]\n return map(list, zip(*read_all))\n\n#################", "row <= 0", "row", "0", "[] for _ in range(col)", "for _ in range(col)", "_", "range(col)", "range", "col", "for _ in range(col)", "[]", "return [[] for _ in range(col)]", "[[] for _ in range(col)]", "elif col == 1:\n return [I() for _ in range(row)]\n ", "col == 1", "col", "1", "I() for _ in range(row)", "for _ in range(row)", "_", "range(row)", "range", "row", "for _ in range(row)", "I()", "I", "return [I() for _ in range(row)]", "[I() for _ in range(row)]", "LI() for _ in range(row)", "for _ in range(row)", "_", "range(row)", "range", "row", "for _ in range(row)", "LI()", "LI", "read_all = [LI() for _ in range(row)]", "read_all", "[LI() for _ in range(row)]", "return map(list, zip(*read_all))", "map(list, zip(*read_all))", "map", "list", "zip(*read_all)", "zip", "*read_all", "read_all", "row", "row", "col", "col", "S = str(input())", "S", "str(input())", "str", "input()", "input", "ans = 0", "ans", "0", "for i,s in enumerate(S):\n if i%2 == 0:\n if s == 'p':\n ans -= 1\n else:\n if s == 'g':\n ans += 1", "i", "s", "enumerate(S)", "enumerate", "S", "if i%2 == 0:\n if s == 'p':\n ans -= 1\n else:\n if s == 'g':\n ans += 1", "i%2 == 0", "i%2", "i", "2", "0", "if s == 'p':\n ans -= 1\n ", "s == 'p'", "s", "'p'", "ans -= 1", "ans", "1", "if s == 'g':\n ans += 1", "s == 'g'", "s", "'g'", "ans += 1", "ans", "1", "print(ans)", "print", "ans", "def I(): return int(input())", "def I(): return int(input())", "I", "def LI(): return list(map(int, input().split()))", "def LI(): return list(map(int, input().split()))", "LI", "mod = 10**9 + 7", "10**9 + 7", "mod", "S = str(input())", "str(input())", "S", "def LIR(row,col):\n if row <= 0:\n return [[] for _ in range(col)]\n elif col == 1:\n return [I() for _ in range(row)]\n else:\n read_all = [LI() for _ in range(row)]\n return map(list, zip(*read_all))\n\n#################", "def LIR(row,col):\n if row <= 0:\n return [[] for _ in range(col)]\n elif col == 1:\n return [I() for _ in range(row)]\n else:\n read_all = [LI() for _ in range(row)]\n return map(list, zip(*read_all))\n\n#################", "LIR", "def input():\n return sys.stdin.readline()[:-1]", "def input():\n return sys.stdin.readline()[:-1]", "input", "ans -= 1", "1", "ans", "ans = 0", "0", "ans", "ans += 1", "1", "ans" ]
import sys import math from collections import defaultdict sys.setrecursionlimit(10**7) def input(): return sys.stdin.readline()[:-1] mod = 10**9 + 7 def I(): return int(input()) def LI(): return list(map(int, input().split())) def LIR(row,col): if row <= 0: return [[] for _ in range(col)] elif col == 1: return [I() for _ in range(row)] else: read_all = [LI() for _ in range(row)] return map(list, zip(*read_all)) ################# S = str(input()) ans = 0 for i,s in enumerate(S): if i%2 == 0: if s == 'p': ans -= 1 else: if s == 'g': ans += 1 print(ans)
[ 7, 0, 13, 4, 13, 0, 13, 17, 0, 13, 17, 0, 13, 17, 28, 13, 13, 14, 2, 13, 13, 0, 13, 17, 14, 2, 13, 17, 0, 13, 17, 0, 13, 17, 14, 2, 13, 17, 0, 13, 17, 4, 13, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13 ]
[ [ 63, 2 ], [ 54, 6 ], [ 57, 9 ], [ 48, 12 ], [ 16, 15 ], [ 64, 15 ], [ 55, 19 ], [ 61, 19 ], [ 58, 20 ], [ 52, 20 ], [ 60, 22 ], [ 15, 26 ], [ 66, 29 ], [ 51, 32 ], [ 15, 36 ], [ 45, 39 ], [ 46, 43 ], [ 67, 43 ], [ 49, 43 ], [ 45, 46 ], [ 48, 49 ], [ 51, 52 ], [ 54, 55 ], [ 57, 58 ], [ 60, 61 ], [ 63, 64 ], [ 66, 67 ] ]
[ "s = input()\ng = 0\np = 0\nans = 0\nfor i in s:\n if g == p:\n g += 1\n if i == \"p\":\n ans -= 1\n else:\n p += 1\n if i == \"g\":\n ans += 1\nprint(ans)", "s = input()", "s", "input()", "input", "g = 0", "g", "0", "p = 0", "p", "0", "ans = 0", "ans", "0", "for i in s:\n if g == p:\n g += 1\n if i == \"p\":\n ans -= 1\n else:\n p += 1\n if i == \"g\":\n ans += 1", "i", "s", "if g == p:\n g += 1\n if i == \"p\":\n ans -= 1\n else:\n p += 1\n if i == \"g\":\n ans += 1", "g == p", "g", "p", "g += 1", "g", "1", "if i == \"p\":\n ans -= 1\n ", "i == \"p\"", "i", "\"p\"", "ans -= 1", "ans", "1", "p += 1", "p", "1", "if i == \"g\":\n ans += 1", "i == \"g\"", "i", "\"g\"", "ans += 1", "ans", "1", "print(ans)", "print", "ans", "ans += 1", "1", "ans", "ans = 0", "0", "ans", "p += 1", "1", "p", "g = 0", "0", "g", "p = 0", "0", "p", "g += 1", "1", "g", "s = input()", "input()", "s", "ans -= 1", "1", "ans" ]
s = input() g = 0 p = 0 ans = 0 for i in s: if g == p: g += 1 if i == "p": ans -= 1 else: p += 1 if i == "g": ans += 1 print(ans)
[ 7, 12, 13, 0, 13, 4, 13, 4, 13, 0, 13, 17, 0, 13, 17, 0, 13, 17, 28, 13, 13, 14, 2, 13, 17, 14, 2, 13, 13, 0, 13, 17, 0, 13, 17, 0, 13, 17, 14, 2, 13, 13, 0, 13, 17, 0, 13, 17, 0, 13, 17, 4, 13, 13, 4, 13, 10, 12, 13 ]
[ [ 5, 4 ], [ 11, 10 ], [ 14, 13 ], [ 17, 16 ], [ 20, 19 ], [ 4, 19 ], [ 19, 23 ], [ 13, 27 ], [ 43, 27 ], [ 30, 27 ], [ 10, 28 ], [ 46, 28 ], [ 36, 28 ], [ 31, 30 ], [ 34, 33 ], [ 37, 36 ], [ 13, 40 ], [ 43, 40 ], [ 30, 40 ], [ 10, 41 ], [ 46, 41 ], [ 36, 41 ], [ 44, 43 ], [ 47, 46 ], [ 50, 49 ], [ 49, 53 ], [ 33, 53 ], [ 16, 53 ], [ 58, 55 ] ]
[ "def main():\n S = list(input())\n num_stone = 0\n num_paper = 0\n ans = 0\n for c in S:\n if c == 'g':\n if num_paper < num_stone:\n num_paper += 1\n ans += 1\n else:\n num_stone += 1\n else:\n if num_paper < num_stone:\n num_paper += 1\n else:\n num_stone += 1\n ans -= 1\n print(ans)\nmain()", "def main():\n S = list(input())\n num_stone = 0\n num_paper = 0\n ans = 0\n for c in S:\n if c == 'g':\n if num_paper < num_stone:\n num_paper += 1\n ans += 1\n else:\n num_stone += 1\n else:\n if num_paper < num_stone:\n num_paper += 1\n else:\n num_stone += 1\n ans -= 1\n print(ans)", "main", "S = list(input())", "S", "list(input())", "list", "input()", "input", "num_stone = 0", "num_stone", "0", "num_paper = 0", "num_paper", "0", "ans = 0", "ans", "0", "for c in S:\n if c == 'g':\n if num_paper < num_stone:\n num_paper += 1\n ans += 1\n else:\n num_stone += 1\n else:\n if num_paper < num_stone:\n num_paper += 1\n else:\n num_stone += 1\n ans -= 1\n ", "c", "S", "if c == 'g':\n if num_paper < num_stone:\n num_paper += 1\n ans += 1\n else:\n num_stone += 1\n else:\n if num_paper < num_stone:\n num_paper += 1\n else:\n num_stone += 1\n ans -= 1\n ", "c == 'g'", "c", "'g'", "if num_paper < num_stone:\n num_paper += 1\n ans += 1\n else:\n num_stone += 1\n ", "num_paper < num_stone", "num_paper", "num_stone", "num_paper += 1", "num_paper", "1", "ans += 1", "ans", "1", "num_stone += 1", "num_stone", "1", "if num_paper < num_stone:\n num_paper += 1\n else:\n num_stone += 1\n ans -= 1\n ", "num_paper < num_stone", "num_paper", "num_stone", "num_paper += 1", "num_paper", "1", "num_stone += 1", "num_stone", "1", "ans -= 1", "ans", "1", "print(ans)", "print", "ans", "main()", "main", "def main():\n S = list(input())\n num_stone = 0\n num_paper = 0\n ans = 0\n for c in S:\n if c == 'g':\n if num_paper < num_stone:\n num_paper += 1\n ans += 1\n else:\n num_stone += 1\n else:\n if num_paper < num_stone:\n num_paper += 1\n else:\n num_stone += 1\n ans -= 1\n print(ans)", "def main():\n S = list(input())\n num_stone = 0\n num_paper = 0\n ans = 0\n for c in S:\n if c == 'g':\n if num_paper < num_stone:\n num_paper += 1\n ans += 1\n else:\n num_stone += 1\n else:\n if num_paper < num_stone:\n num_paper += 1\n else:\n num_stone += 1\n ans -= 1\n print(ans)", "main" ]
def main(): S = list(input()) num_stone = 0 num_paper = 0 ans = 0 for c in S: if c == 'g': if num_paper < num_stone: num_paper += 1 ans += 1 else: num_stone += 1 else: if num_paper < num_stone: num_paper += 1 else: num_stone += 1 ans -= 1 print(ans) main()
[ 7, 0, 13, 4, 13, 0, 13, 4, 13, 13, 0, 13, 39, 28, 13, 4, 13, 13, 4, 18, 13, 13, 18, 13, 13, 0, 13, 17, 0, 13, 17, 0, 13, 17, 0, 13, 17, 28, 13, 4, 13, 13, 14, 2, 18, 13, 13, 17, 14, 40, 13, 2, 13, 17, 0, 13, 17, 0, 13, 17, 0, 13, 17, 14, 40, 13, 2, 13, 17, 0, 13, 17, 0, 13, 17, 0, 13, 17, 4, 13, 2, 13, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 39, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13, 10, 17, 13 ]
[ [ 105, 2 ], [ 114, 6 ], [ 106, 9 ], [ 93, 11 ], [ 15, 14 ], [ 115, 17 ], [ 94, 20 ], [ 106, 23 ], [ 14, 24 ], [ 96, 26 ], [ 102, 29 ], [ 84, 32 ], [ 117, 35 ], [ 39, 38 ], [ 115, 41 ], [ 94, 45 ], [ 38, 46 ], [ 97, 50 ], [ 100, 50 ], [ 121, 50 ], [ 103, 52 ], [ 88, 52 ], [ 112, 52 ], [ 90, 55 ], [ 111, 58 ], [ 120, 61 ], [ 97, 65 ], [ 100, 65 ], [ 121, 65 ], [ 103, 67 ], [ 88, 67 ], [ 112, 67 ], [ 87, 70 ], [ 99, 73 ], [ 108, 76 ], [ 91, 81 ], [ 85, 81 ], [ 109, 82 ], [ 118, 82 ], [ 84, 85 ], [ 87, 88 ], [ 90, 91 ], [ 93, 94 ], [ 96, 97 ], [ 99, 100 ], [ 102, 103 ], [ 105, 106 ], [ 108, 109 ], [ 111, 112 ], [ 114, 115 ], [ 117, 118 ], [ 120, 121 ] ]
[ "N=input()\nX=len(N)\nA=[]\nfor i in range(X):\n A.append(N[i])\n\n\n\nrock=0\npaper=0\nwin=0\nlose=0\nfor i in range (X):\n if A[i]==\"g\":\n if rock>=paper+1:\n win+=1\n paper+=1\n else:\n rock+=1\n else:\n if rock>=paper+1:\n paper+=1\n else:\n rock+=1\n lose+=1\n\n\nprint(win-lose)", "N=input()", "N", "input()", "input", "X=len(N)", "X", "len(N)", "len", "N", "A=[]", "A", "[]", "for i in range(X):\n A.append(N[i])", "i", "range(X)", "range", "X", "A.append(N[i])", "A.append", "A", "append", "N[i]", "N", "i", "rock=0", "rock", "0", "paper=0", "paper", "0", "win=0", "win", "0", "lose=0", "lose", "0", "for i in range (X):\n if A[i]==\"g\":\n if rock>=paper+1:\n win+=1\n paper+=1\n else:\n rock+=1\n else:\n if rock>=paper+1:\n paper+=1\n else:\n rock+=1\n lose+=1", "i", "range (X)", "range", "X", "if A[i]==\"g\":\n if rock>=paper+1:\n win+=1\n paper+=1\n else:\n rock+=1\n else:\n if rock>=paper+1:\n paper+=1\n else:\n rock+=1\n lose+=1", "A[i]==\"g\"", "A[i]", "A", "i", "\"g\"", "if rock>=paper+1:\n win+=1\n paper+=1\n else:\n rock+=1\n ", "rock>=paper+1", "rock", "paper+1", "paper", "1", "win+=1", "win", "1", "paper+=1", "paper", "1", "rock+=1", "rock", "1", "if rock>=paper+1:\n paper+=1\n else:\n rock+=1\n lose+=1", "rock>=paper+1", "rock", "paper+1", "paper", "1", "paper+=1", "paper", "1", "rock+=1", "rock", "1", "lose+=1", "lose", "1", "print(win-lose)", "print", "win-lose", "win", "lose", "win=0", "0", "win", "paper+=1", "1", "paper", "win+=1", "1", "win", "A=[]", "[]", "A", "rock=0", "0", "rock", "rock+=1", "1", "rock", "paper=0", "0", "paper", "N=input()", "input()", "N", "lose+=1", "1", "lose", "paper+=1", "1", "paper", "X=len(N)", "len(N)", "X", "lose=0", "0", "lose", "rock+=1", "1", "rock" ]
N=input() X=len(N) A=[] for i in range(X): A.append(N[i]) rock=0 paper=0 win=0 lose=0 for i in range (X): if A[i]=="g": if rock>=paper+1: win+=1 paper+=1 else: rock+=1 else: if rock>=paper+1: paper+=1 else: rock+=1 lose+=1 print(win-lose)
[ 7, 0, 13, 4, 13, 0, 13, 17, 0, 13, 17, 0, 13, 17, 28, 13, 4, 13, 4, 13, 13, 14, 2, 18, 13, 13, 17, 0, 13, 17, 0, 13, 17, 0, 13, 4, 13, 2, 2, 13, 13, 17, 14, 2, 13, 13, 0, 13, 13, 0, 13, 13, 14, 2, 13, 13, 0, 13, 13, 0, 13, 13, 0, 13, 2, 2, 17, 13, 2, 17, 13, 28, 13, 4, 13, 4, 13, 13, 14, 40, 18, 13, 13, 18, 13, 13, 14, 2, 2, 18, 13, 13, 17, 2, 18, 13, 13, 17, 0, 13, 17, 14, 2, 2, 18, 13, 13, 17, 2, 18, 13, 13, 17, 0, 13, 17, 4, 13, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 13, 13, 10, 17, 13, 10, 4, 13, 10, 4, 13, 10, 17, 13, 10, 13, 13, 10, 13, 13, 10, 2, 13, 10, 13, 13 ]
[ [ 144, 2 ], [ 126, 6 ], [ 147, 9 ], [ 120, 12 ], [ 16, 15 ], [ 145, 20 ], [ 145, 24 ], [ 15, 25 ], [ 138, 28 ], [ 129, 31 ], [ 141, 34 ], [ 139, 39 ], [ 127, 39 ], [ 130, 40 ], [ 148, 40 ], [ 139, 44 ], [ 127, 44 ], [ 130, 45 ], [ 148, 45 ], [ 150, 47 ], [ 142, 48 ], [ 135, 50 ], [ 142, 51 ], [ 139, 54 ], [ 127, 54 ], [ 130, 55 ], [ 148, 55 ], [ 159, 57 ], [ 142, 58 ], [ 153, 60 ], [ 142, 61 ], [ 156, 63 ], [ 160, 67 ], [ 136, 67 ], [ 130, 67 ], [ 148, 67 ], [ 154, 70 ], [ 151, 70 ], [ 139, 70 ], [ 127, 70 ], [ 73, 72 ], [ 145, 77 ], [ 145, 81 ], [ 72, 82 ], [ 157, 84 ], [ 72, 85 ], [ 145, 90 ], [ 72, 91 ], [ 157, 95 ], [ 72, 96 ], [ 132, 99 ], [ 145, 105 ], [ 72, 106 ], [ 157, 110 ], [ 72, 111 ], [ 123, 114 ], [ 124, 118 ], [ 133, 118 ], [ 121, 118 ], [ 120, 121 ], [ 123, 124 ], [ 126, 127 ], [ 129, 130 ], [ 132, 133 ], [ 142, 135 ], [ 135, 136 ], [ 138, 139 ], [ 141, 142 ], [ 144, 145 ], [ 147, 148 ], [ 142, 150 ], [ 150, 151 ], [ 142, 153 ], [ 153, 154 ], [ 156, 157 ], [ 142, 159 ], [ 159, 160 ] ]
[ "a = input()\ng = 0\np = 0\ns = 0\nfor i in range(len(a)):\n if a[i] == \"g\":\n g += 1\n else:\n p += 1\nc = abs((g-p)//2)\nif g < p:\n g += c\n p -= c\nelif g > p:\n p += c\n g -= c\nd = \"p\" * p + \"g\" * g\nfor i in range(len(a)):\n if a[i] != d[i]:\n if a[i] == \"p\" and d[i] == \"g\":\n s -= 1\n elif a[i] == \"g\" and d[i] == \"p\":\n s += 1\nprint(s)", "a = input()", "a", "input()", "input", "g = 0", "g", "0", "p = 0", "p", "0", "s = 0", "s", "0", "for i in range(len(a)):\n if a[i] == \"g\":\n g += 1\n else:\n p += 1", "i", "range(len(a))", "range", "len(a)", "len", "a", "if a[i] == \"g\":\n g += 1\n else:\n p += 1", "a[i] == \"g\"", "a[i]", "a", "i", "\"g\"", "g += 1", "g", "1", "p += 1", "p", "1", "c = abs((g-p)//2)", "c", "abs((g-p)//2)", "abs", "(g-p)//2", "g-p", "g", "p", "2", "if g < p:\n g += c\n p -= c\nelif g > p:\n p += c\n g -= c", "g < p", "g", "p", "g += c", "g", "c", "p -= c", "p", "c", "elif g > p:\n p += c\n g -= c", "g > p", "g", "p", "p += c", "p", "c", "g -= c", "g", "c", "d = \"p\" * p + \"g\" * g", "d", "\"p\" * p + \"g\" * g", "\"p\" * p", "\"p\"", "p", "\"g\" * g", "\"g\"", "g", "for i in range(len(a)):\n if a[i] != d[i]:\n if a[i] == \"p\" and d[i] == \"g\":\n s -= 1\n elif a[i] == \"g\" and d[i] == \"p\":\n s += 1", "i", "range(len(a))", "range", "len(a)", "len", "a", "if a[i] != d[i]:\n if a[i] == \"p\" and d[i] == \"g\":\n s -= 1\n elif a[i] == \"g\" and d[i] == \"p\":\n s += 1", "a[i] != d[i]", "a[i]", "a", "i", "d[i]", "d", "i", "if a[i] == \"p\" and d[i] == \"g\":\n s -= 1\n elif a[i] == \"g\" and d[i] == \"p\":\n s += 1", "a[i] == \"p\" and d[i] == \"g\"", "a[i] == \"p\"", "a[i]", "a", "i", "\"p\"", "d[i] == \"g\"", "d[i]", "d", "i", "\"g\"", "s -= 1", "s", "1", "elif a[i] == \"g\" and d[i] == \"p\":\n s += 1", "a[i] == \"g\" and d[i] == \"p\"", "a[i] == \"g\"", "a[i]", "a", "i", "\"g\"", "d[i] == \"p\"", "d[i]", "d", "i", "\"p\"", "s += 1", "s", "1", "print(s)", "print", "s", "s = 0", "0", "s", "s += 1", "1", "s", "g = 0", "0", "g", "p += 1", "1", "p", "s -= 1", "1", "s", "p -= c", "c", "p", "g += 1", "1", "g", "c = abs((g-p)//2)", "abs((g-p)//2)", "c", "a = input()", "input()", "a", "p = 0", "0", "p", "g += c", "c", "g", "g -= c", "c", "g", "d = \"p\" * p + \"g\" * g", "\"p\" * p + \"g\" * g", "d", "p += c", "c", "p" ]
a = input() g = 0 p = 0 s = 0 for i in range(len(a)): if a[i] == "g": g += 1 else: p += 1 c = abs((g-p)//2) if g < p: g += c p -= c elif g > p: p += c g -= c d = "p" * p + "g" * g for i in range(len(a)): if a[i] != d[i]: if a[i] == "p" and d[i] == "g": s -= 1 elif a[i] == "g" and d[i] == "p": s += 1 print(s)
[ 7, 0, 13, 4, 13, 0, 13, 4, 13, 13, 0, 13, 17, 28, 13, 4, 13, 13, 14, 2, 18, 13, 13, 17, 0, 13, 17, 0, 13, 17, 0, 13, 2, 13, 17, 4, 13, 2, 13, 17, 10, 2, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13 ]
[ [ 47, 2 ], [ 53, 6 ], [ 48, 9 ], [ 44, 11 ], [ 15, 14 ], [ 54, 17 ], [ 48, 21 ], [ 14, 22 ], [ 56, 25 ], [ 50, 28 ], [ 41, 31 ], [ 54, 33 ], [ 42, 38 ], [ 51, 38 ], [ 57, 38 ], [ 45, 38 ], [ 41, 42 ], [ 44, 45 ], [ 47, 48 ], [ 50, 51 ], [ 53, 54 ], [ 56, 57 ] ]
[ "s=input()\nn=len(s)\n\nc=0\nfor i in range(n):\n if s[i]==\"g\":\n c+=1\n else:\n c-=1\n\nc+=n%1\n\nprint(c//2)", "s=input()", "s", "input()", "input", "n=len(s)", "n", "len(s)", "len", "s", "c=0", "c", "0", "for i in range(n):\n if s[i]==\"g\":\n c+=1\n else:\n c-=1", "i", "range(n)", "range", "n", "if s[i]==\"g\":\n c+=1\n else:\n c-=1", "s[i]==\"g\"", "s[i]", "s", "i", "\"g\"", "c+=1", "c", "1", "c-=1", "c", "1", "c+=n%1", "c", "n%1", "n", "1", "print(c//2)", "print", "c//2", "c", "2", "c+=n%1", "n%1", "c", "c=0", "0", "c", "s=input()", "input()", "s", "c-=1", "1", "c", "n=len(s)", "len(s)", "n", "c+=1", "1", "c" ]
s=input() n=len(s) c=0 for i in range(n): if s[i]=="g": c+=1 else: c-=1 c+=n%1 print(c//2)
[ 7, 0, 13, 4, 13, 0, 13, 17, 28, 13, 13, 4, 13, 13, 14, 2, 2, 2, 13, 17, 17, 2, 13, 17, 0, 13, 17, 14, 2, 2, 2, 13, 17, 17, 2, 13, 17, 0, 13, 17, 4, 13, 13, 10, 17, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13 ]
[ [ 50, 2 ], [ 44, 6 ], [ 51, 13 ], [ 47, 25 ], [ 53, 38 ], [ 54, 42 ], [ 48, 42 ], [ 45, 42 ], [ 44, 45 ], [ 47, 48 ], [ 50, 51 ], [ 53, 54 ] ]
[ "s = input()\n\nans = 0\nfor i, x in enumerate(s):\n if i % 2 == 0 and x == 'p':\n ans -= 1\n elif i % 2 == 1 and x == 'g':\n ans += 1\n\nprint(ans)", "s = input()", "s", "input()", "input", "ans = 0", "ans", "0", "for i, x in enumerate(s):\n if i % 2 == 0 and x == 'p':\n ans -= 1\n elif i % 2 == 1 and x == 'g':\n ans += 1", "i", "x", "enumerate(s)", "enumerate", "s", "if i % 2 == 0 and x == 'p':\n ans -= 1\n elif i % 2 == 1 and x == 'g':\n ans += 1", "i % 2 == 0 and x == 'p'", "i % 2 == 0", "i % 2", "i", "2", "0", "x == 'p'", "x", "'p'", "ans -= 1", "ans", "1", "elif i % 2 == 1 and x == 'g':\n ans += 1", "i % 2 == 1 and x == 'g'", "i % 2 == 1", "i % 2", "i", "2", "1", "x == 'g'", "x", "'g'", "ans += 1", "ans", "1", "print(ans)", "print", "ans", "ans = 0", "0", "ans", "ans -= 1", "1", "ans", "s = input()", "input()", "s", "ans += 1", "1", "ans" ]
s = input() ans = 0 for i, x in enumerate(s): if i % 2 == 0 and x == 'p': ans -= 1 elif i % 2 == 1 and x == 'g': ans += 1 print(ans)
[ 7, 0, 13, 4, 13, 0, 13, 17, 28, 13, 4, 13, 4, 13, 13, 14, 2, 2, 2, 13, 17, 17, 2, 18, 13, 13, 17, 0, 13, 13, 14, 2, 2, 2, 13, 17, 17, 2, 18, 13, 13, 17, 0, 13, 2, 13, 17, 14, 2, 2, 2, 13, 17, 17, 2, 18, 13, 13, 17, 0, 13, 2, 13, 17, 14, 2, 2, 2, 13, 17, 17, 2, 18, 13, 13, 17, 0, 13, 13, 4, 13, 13, 10, 17, 13, 10, 13, 13, 10, 2, 13, 10, 13, 13, 10, 2, 13, 10, 4, 13 ]
[ [ 98, 2 ], [ 83, 6 ], [ 10, 9 ], [ 99, 14 ], [ 9, 19 ], [ 99, 24 ], [ 9, 25 ], [ 92, 28 ], [ 93, 29 ], [ 84, 29 ], [ 87, 29 ], [ 96, 29 ], [ 90, 29 ], [ 9, 34 ], [ 99, 39 ], [ 9, 40 ], [ 89, 43 ], [ 93, 45 ], [ 84, 45 ], [ 87, 45 ], [ 96, 45 ], [ 90, 45 ], [ 9, 51 ], [ 99, 56 ], [ 9, 57 ], [ 95, 60 ], [ 90, 62 ], [ 93, 62 ], [ 84, 62 ], [ 87, 62 ], [ 96, 62 ], [ 9, 68 ], [ 99, 73 ], [ 9, 74 ], [ 86, 77 ], [ 87, 78 ], [ 96, 78 ], [ 90, 78 ], [ 93, 78 ], [ 84, 78 ], [ 87, 81 ], [ 96, 81 ], [ 90, 81 ], [ 93, 81 ], [ 84, 81 ], [ 83, 84 ], [ 87, 86 ], [ 96, 86 ], [ 90, 86 ], [ 93, 86 ], [ 84, 86 ], [ 86, 87 ], [ 89, 90 ], [ 93, 92 ], [ 84, 92 ], [ 87, 92 ], [ 96, 92 ], [ 90, 92 ], [ 92, 93 ], [ 95, 96 ], [ 98, 99 ] ]
[ "s=input()\ncount=0\nfor i in range(len(s)):\n if(i%2==0 and s[i]=='g'):\n count=count\n if(i%2==0 and s[i]=='p'):\n count=count-1\n if(i%2==1 and s[i]=='g'):\n count=count+1\n if(i%2==1 and s[i]=='p'):\n count=count\n\nprint(count)", "s=input()", "s", "input()", "input", "count=0", "count", "0", "for i in range(len(s)):\n if(i%2==0 and s[i]=='g'):\n count=count\n if(i%2==0 and s[i]=='p'):\n count=count-1\n if(i%2==1 and s[i]=='g'):\n count=count+1\n if(i%2==1 and s[i]=='p'):\n count=count", "i", "range(len(s))", "range", "len(s)", "len", "s", "if(i%2==0 and s[i]=='g'):\n count=count\n ", "i%2==0 and s[i]=='g'", "i%2==0", "i%2", "i", "2", "0", "s[i]=='g'", "s[i]", "s", "i", "'g'", "count=count", "count", "count", "if(i%2==0 and s[i]=='p'):\n count=count-1\n ", "i%2==0 and s[i]=='p'", "i%2==0", "i%2", "i", "2", "0", "s[i]=='p'", "s[i]", "s", "i", "'p'", "count=count-1", "count", "count-1", "count", "1", "if(i%2==1 and s[i]=='g'):\n count=count+1\n ", "i%2==1 and s[i]=='g'", "i%2==1", "i%2", "i", "2", "1", "s[i]=='g'", "s[i]", "s", "i", "'g'", "count=count+1", "count", "count+1", "count", "1", "if(i%2==1 and s[i]=='p'):\n count=count", "i%2==1 and s[i]=='p'", "i%2==1", "i%2", "i", "2", "1", "s[i]=='p'", "s[i]", "s", "i", "'p'", "count=count", "count", "count", "print(count)", "print", "count", "count=0", "0", "count", "count=count", "count", "count", "count=count-1", "count-1", "count", "count=count", "count", "count", "count=count+1", "count+1", "count", "s=input()", "input()", "s" ]
s=input() count=0 for i in range(len(s)): if(i%2==0 and s[i]=='g'): count=count if(i%2==0 and s[i]=='p'): count=count-1 if(i%2==1 and s[i]=='g'): count=count+1 if(i%2==1 and s[i]=='p'): count=count print(count)
[ 7, 15, 15, 13, 12, 13, 12, 13, 12, 13, 12, 13, 41, 28, 13, 4, 13, 13, 4, 4, 13, 12, 13, 23, 13, 41, 28, 13, 4, 13, 13, 4, 4, 13, 12, 13, 23, 13, 41, 28, 13, 4, 13, 13, 4, 4, 13, 12, 13, 23, 13, 0, 13, 17, 17, 17, 17, 17, 17, 17, 0, 13, 4, 13, 4, 13, 0, 13, 17, 0, 13, 17, 28, 13, 13, 14, 2, 13, 17, 0, 13, 17, 0, 13, 17, 0, 13, 2, 2, 13, 13, 17, 4, 13, 13, 10, 12, 13, 10, 17, 13, 10, 17, 13, 10, 2, 13, 10, 12, 13, 10, 17, 13, 10, 17, 13, 10, 12, 13, 10, 12, 13, 10, 17, 13, 10, 4, 13, 10, 12, 13, 10, 12, 13, 10, 12, 13 ]
[ [ 15, 14 ], [ 121, 20 ], [ 24, 24 ], [ 28, 27 ], [ 109, 33 ], [ 37, 37 ], [ 41, 40 ], [ 133, 46 ], [ 50, 50 ], [ 102, 52 ], [ 126, 61 ], [ 133, 65 ], [ 111, 67 ], [ 114, 70 ], [ 74, 73 ], [ 127, 73 ], [ 73, 77 ], [ 123, 80 ], [ 99, 83 ], [ 105, 86 ], [ 124, 89 ], [ 115, 89 ], [ 100, 90 ], [ 112, 90 ], [ 106, 94 ], [ 99, 100 ], [ 102, 103 ], [ 105, 106 ], [ 111, 112 ], [ 114, 115 ], [ 123, 124 ], [ 126, 127 ] ]
[ "#!usr/bin/env python3\nfrom collections import defaultdict\nimport math\ndef LI(): return list(map(int, input().split()))\ndef II(): return int(input())\ndef LS(): return input().split()\ndef S(): return input()\ndef IIR(n): return [II() for i in range(n)]\ndef LIR(n): return [LI() for i in range(n)]\ndef SR(n): return [S() for i in range(n)]\nmod = 1000000007\n\n#A\n\"\"\"\na,b = LS()\nc = int(a+b)\nfor i in range(1,1000):\n if i * i == c:\n print(\"Yes\")\n quit()\nprint(\"No\")\n\"\"\"\n\n#B\n\"\"\"\na,b = LI()\nif a*b <= 0:\n print(\"Zero\")\nelse:\n if b < 0:\n if (a-b) %2 == 1:\n print(\"Positive\")\n else:\n print(\"Negative\")\n else:\n print(\"Positive\")\n\"\"\"\n\n#C\n\"\"\"\nn = II()\ns = SR(n)\nmarch = [[] for i in range(5)]\nch = list(\"MARCH\")\nfor i in s:\n for j in range(5):\n if i[0] == ch[j]:\n march[j].append(i)\nans = 0\nfor i in range(5):\n for j in range(i):\n for k in range(j):\n if len(march[i])*len(march[j])*len(march[k]) == 0:\n break\n ans += len(march[i])*len(march[j])*len(march[k])\nprint(ans)\n\"\"\"\n\n#D\n\"\"\"\nn = II()\nd = LIR(n)\nq = II()\np = IIR(q)\nd.insert(0,[0 for i in range(n+1)])\nfor i in range(n):\n d[i+1].insert(0,0)\nfor i in range(n):\n for j in range(n):\n d[i+1][j+1] += d[i+1][j]+d[i][j+1]-d[i][j]\nans = [0 for i in range(n**2+1)]\n\nfor a in range(n+1):\n for b in range(n+1):\n for c in range(a):\n for e in range(b):\n ans[(a-c)*(b-e)] = max(ans[(a-c)*(b-e)],d[a][b]-d[c][b]-d[a][e]+d[c][e])\n\nfor i in p:\n an = 0\n for a in range(i+1):\n an = max(an, ans[a])\n print(an)\n\"\"\"\n#E\n\n\"\"\"\ns = list(S())\nans = -1\ns.insert(0,0)\nd = 0\nfor i in range(1,len(s)):\n if s[i] != d:\n d = s[i]\n ans += 1\nprint(ans)\n\"\"\"\n\n#F\n\"\"\"\nn = II()\nx,y = LI()\nfor _ in range(n-1):\n a,b = LI()\n if a == b:\n x = max(x,y)\n y = x\n else:\n i = max(x//a,y//b)\n while 1:\n if a*i >= x and b*i >= y:break\n i += 1\n x = a*i\n y = b*i\nprint(x+y)\n\"\"\"\n#G\n\ns = list(S())\np = 0\ng = 0\nfor i in s:\n if i == \"g\":\n g += 1\n else:\n p += 1\nans = (g-p)//2\nprint(ans)\n\n\n#H\n\n#I\n\n#J\n\n#K\n\n#L\n\n#M\n\n#N\n\n#O\n\n#P\n\n#Q\n\n#R\n\n#S\n\n#T", "from collections import defaultdict", "import math", "math", "def LI(): return list(map(int, input().split()))", "LI", "def II(): return int(input())", "II", "def LS(): return input().split()", "LS", "def S(): return input()", "S", "II() for i in range(n)", "for i in range(n)", "i", "range(n)", "range", "n", "for i in range(n)", "II()", "II", "def IIR(n): return [II() for i in range(n)]", "IIR", "n", "n", "LI() for i in range(n)", "for i in range(n)", "i", "range(n)", "range", "n", "for i in range(n)", "LI()", "LI", "def LIR(n): return [LI() for i in range(n)]", "LIR", "n", "n", "S() for i in range(n)", "for i in range(n)", "i", "range(n)", "range", "n", "for i in range(n)", "S()", "S", "def SR(n): return [S() for i in range(n)]", "SR", "n", "n", "mod = 1000000007", "mod", "1000000007", "\"\"\"\na,b = LS()\nc = int(a+b)\nfor i in range(1,1000):\n if i * i == c:\n print(\"Yes\")\n quit()\nprint(\"No\")\n\"\"\"", "\"\"\"\na,b = LI()\nif a*b <= 0:\n print(\"Zero\")\nelse:\n if b < 0:\n if (a-b) %2 == 1:\n print(\"Positive\")\n else:\n print(\"Negative\")\n else:\n print(\"Positive\")\n\"\"\"", "\"\"\"\nn = II()\ns = SR(n)\nmarch = [[] for i in range(5)]\nch = list(\"MARCH\")\nfor i in s:\n for j in range(5):\n if i[0] == ch[j]:\n march[j].append(i)\nans = 0\nfor i in range(5):\n for j in range(i):\n for k in range(j):\n if len(march[i])*len(march[j])*len(march[k]) == 0:\n break\n ans += len(march[i])*len(march[j])*len(march[k])\nprint(ans)\n\"\"\"", "\"\"\"\nn = II()\nd = LIR(n)\nq = II()\np = IIR(q)\nd.insert(0,[0 for i in range(n+1)])\nfor i in range(n):\n d[i+1].insert(0,0)\nfor i in range(n):\n for j in range(n):\n d[i+1][j+1] += d[i+1][j]+d[i][j+1]-d[i][j]\nans = [0 for i in range(n**2+1)]\n\nfor a in range(n+1):\n for b in range(n+1):\n for c in range(a):\n for e in range(b):\n ans[(a-c)*(b-e)] = max(ans[(a-c)*(b-e)],d[a][b]-d[c][b]-d[a][e]+d[c][e])\n\nfor i in p:\n an = 0\n for a in range(i+1):\n an = max(an, ans[a])\n print(an)\n\"\"\"", "\"\"\"\ns = list(S())\nans = -1\ns.insert(0,0)\nd = 0\nfor i in range(1,len(s)):\n if s[i] != d:\n d = s[i]\n ans += 1\nprint(ans)\n\"\"\"", "\"\"\"\nn = II()\nx,y = LI()\nfor _ in range(n-1):\n a,b = LI()\n if a == b:\n x = max(x,y)\n y = x\n else:\n i = max(x//a,y//b)\n while 1:\n if a*i >= x and b*i >= y:break\n i += 1\n x = a*i\n y = b*i\nprint(x+y)\n\"\"\"", "s = list(S())", "s", "list(S())", "list", "S()", "S", "p = 0", "p", "0", "g = 0", "g", "0", "for i in s:\n if i == \"g\":\n g += 1\n else:\n p += 1", "i", "s", "if i == \"g\":\n g += 1\n else:\n p += 1", "i == \"g\"", "i", "\"g\"", "g += 1", "g", "1", "p += 1", "p", "1", "ans = (g-p)//2", "ans", "(g-p)//2", "g-p", "g", "p", "2", "print(ans)", "print", "ans", "def LS(): return input().split()", "def LS(): return input().split()", "LS", "p += 1", "1", "p", "mod = 1000000007", "1000000007", "mod", "ans = (g-p)//2", "(g-p)//2", "ans", "def LI(): return list(map(int, input().split()))", "def LI(): return list(map(int, input().split()))", "LI", "p = 0", "0", "p", "g = 0", "0", "g", "def LIR(n): return [LI() for i in range(n)]", "def LIR(n): return [LI() for i in range(n)]", "LIR", "def II(): return int(input())", "def II(): return int(input())", "II", "g += 1", "1", "g", "s = list(S())", "list(S())", "s", "def IIR(n): return [II() for i in range(n)]", "def IIR(n): return [II() for i in range(n)]", "IIR", "def S(): return input()", "def S(): return input()", "S", "def SR(n): return [S() for i in range(n)]", "def SR(n): return [S() for i in range(n)]", "SR" ]
#!usr/bin/env python3 from collections import defaultdict import math def LI(): return list(map(int, input().split())) def II(): return int(input()) def LS(): return input().split() def S(): return input() def IIR(n): return [II() for i in range(n)] def LIR(n): return [LI() for i in range(n)] def SR(n): return [S() for i in range(n)] mod = 1000000007 #A """ a,b = LS() c = int(a+b) for i in range(1,1000): if i * i == c: print("Yes") quit() print("No") """ #B """ a,b = LI() if a*b <= 0: print("Zero") else: if b < 0: if (a-b) %2 == 1: print("Positive") else: print("Negative") else: print("Positive") """ #C """ n = II() s = SR(n) march = [[] for i in range(5)] ch = list("MARCH") for i in s: for j in range(5): if i[0] == ch[j]: march[j].append(i) ans = 0 for i in range(5): for j in range(i): for k in range(j): if len(march[i])*len(march[j])*len(march[k]) == 0: break ans += len(march[i])*len(march[j])*len(march[k]) print(ans) """ #D """ n = II() d = LIR(n) q = II() p = IIR(q) d.insert(0,[0 for i in range(n+1)]) for i in range(n): d[i+1].insert(0,0) for i in range(n): for j in range(n): d[i+1][j+1] += d[i+1][j]+d[i][j+1]-d[i][j] ans = [0 for i in range(n**2+1)] for a in range(n+1): for b in range(n+1): for c in range(a): for e in range(b): ans[(a-c)*(b-e)] = max(ans[(a-c)*(b-e)],d[a][b]-d[c][b]-d[a][e]+d[c][e]) for i in p: an = 0 for a in range(i+1): an = max(an, ans[a]) print(an) """ #E """ s = list(S()) ans = -1 s.insert(0,0) d = 0 for i in range(1,len(s)): if s[i] != d: d = s[i] ans += 1 print(ans) """ #F """ n = II() x,y = LI() for _ in range(n-1): a,b = LI() if a == b: x = max(x,y) y = x else: i = max(x//a,y//b) while 1: if a*i >= x and b*i >= y:break i += 1 x = a*i y = b*i print(x+y) """ #G s = list(S()) p = 0 g = 0 for i in s: if i == "g": g += 1 else: p += 1 ans = (g-p)//2 print(ans) #H #I #J #K #L #M #N #O #P #Q #R #S #T
[ 7, 15, 13, 0, 13, 4, 13, 41, 28, 13, 4, 13, 4, 13, 13, 4, 8, 2, 18, 13, 13, 17, 17, 17, 0, 13, 4, 18, 13, 13, 13, 41, 28, 13, 4, 13, 4, 13, 13, 4, 8, 2, 2, 13, 17, 17, 17, 17, 0, 13, 4, 18, 13, 13, 13, 4, 13, 4, 18, 13, 13, 2, 13, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13 ]
[ [ 68, 4 ], [ 10, 9 ], [ 69, 14 ], [ 69, 19 ], [ 9, 20 ], [ 65, 25 ], [ 34, 33 ], [ 69, 38 ], [ 33, 43 ], [ 71, 49 ], [ 72, 62 ], [ 66, 63 ], [ 65, 66 ], [ 68, 69 ], [ 71, 72 ] ]
[ "import numpy as np\n\ns = input()\ns_list = np.array([1 if s[i] == \"p\" else 0 for i in range(len(s))])\nmyhand = np.array([0 if i % 2 == 0 else 1 for i in range(len(s))])\nprint(np.sum(myhand - s_list))", "import numpy as np", "numpy", "s = input()", "s", "input()", "input", "1 if s[i] == \"p\" else 0 for i in range(len(s))", "for i in range(len(s))", "i", "range(len(s))", "range", "len(s)", "len", "s", "for i in range(len(s))", "1 if s[i] == \"p\" else 0", "s[i] == \"p\"", "s[i]", "s", "i", "\"p\"", "1", "0", "s_list = np.array([1 if s[i] == \"p\" else 0 for i in range(len(s))])", "s_list", "np.array([1 if s[i] == \"p\" else 0 for i in range(len(s))])", "np.array", "np", "array", "[1 if s[i] == \"p\" else 0 for i in range(len(s))]", "0 if i % 2 == 0 else 1 for i in range(len(s))", "for i in range(len(s))", "i", "range(len(s))", "range", "len(s)", "len", "s", "for i in range(len(s))", "0 if i % 2 == 0 else 1", "i % 2 == 0", "i % 2", "i", "2", "0", "0", "1", "myhand = np.array([0 if i % 2 == 0 else 1 for i in range(len(s))])", "myhand", "np.array([0 if i % 2 == 0 else 1 for i in range(len(s))])", "np.array", "np", "array", "[0 if i % 2 == 0 else 1 for i in range(len(s))]", "print(np.sum(myhand - s_list))", "print", "np.sum(myhand - s_list)", "np.sum", "np", "sum", "myhand - s_list", "myhand", "s_list", "s_list = np.array([1 if s[i] == \"p\" else 0 for i in range(len(s))])", "np.array([1 if s[i] == \"p\" else 0 for i in range(len(s))])", "s_list", "s = input()", "input()", "s", "myhand = np.array([0 if i % 2 == 0 else 1 for i in range(len(s))])", "np.array([0 if i % 2 == 0 else 1 for i in range(len(s))])", "myhand" ]
import numpy as np s = input() s_list = np.array([1 if s[i] == "p" else 0 for i in range(len(s))]) myhand = np.array([0 if i % 2 == 0 else 1 for i in range(len(s))]) print(np.sum(myhand - s_list))
[ 7, 0, 13, 4, 13, 0, 13, 4, 13, 13, 0, 13, 17, 28, 13, 4, 13, 13, 14, 2, 2, 13, 17, 17, 14, 2, 18, 13, 13, 17, 0, 13, 17, 14, 2, 2, 13, 17, 17, 14, 2, 18, 13, 13, 17, 0, 13, 17, 4, 13, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13, 10, 17, 13, 10, 4, 13 ]
[ [ 55, 2 ], [ 64, 6 ], [ 56, 9 ], [ 58, 11 ], [ 15, 14 ], [ 65, 17 ], [ 14, 21 ], [ 56, 27 ], [ 14, 28 ], [ 61, 31 ], [ 14, 36 ], [ 56, 42 ], [ 14, 43 ], [ 52, 46 ], [ 53, 50 ], [ 62, 50 ], [ 59, 50 ], [ 52, 53 ], [ 55, 56 ], [ 58, 59 ], [ 61, 62 ], [ 64, 65 ] ]
[ "s = input()\nn = len(s)\n\nans = 0\nfor i in range(n):\n if i%2 == 0:\n if s[i] == \"p\":\n ans -= 1\n if i%2 == 1:\n if s[i] == \"g\":\n ans += 1\n \nprint(ans)", "s = input()", "s", "input()", "input", "n = len(s)", "n", "len(s)", "len", "s", "ans = 0", "ans", "0", "for i in range(n):\n if i%2 == 0:\n if s[i] == \"p\":\n ans -= 1\n if i%2 == 1:\n if s[i] == \"g\":\n ans += 1\n ", "i", "range(n)", "range", "n", "if i%2 == 0:\n if s[i] == \"p\":\n ans -= 1\n ", "i%2 == 0", "i%2", "i", "2", "0", "if s[i] == \"p\":\n ans -= 1\n ", "s[i] == \"p\"", "s[i]", "s", "i", "\"p\"", "ans -= 1", "ans", "1", "if i%2 == 1:\n if s[i] == \"g\":\n ans += 1\n ", "i%2 == 1", "i%2", "i", "2", "1", "if s[i] == \"g\":\n ans += 1\n ", "s[i] == \"g\"", "s[i]", "s", "i", "\"g\"", "ans += 1", "ans", "1", "print(ans)", "print", "ans", "ans += 1", "1", "ans", "s = input()", "input()", "s", "ans = 0", "0", "ans", "ans -= 1", "1", "ans", "n = len(s)", "len(s)", "n" ]
s = input() n = len(s) ans = 0 for i in range(n): if i%2 == 0: if s[i] == "p": ans -= 1 if i%2 == 1: if s[i] == "g": ans += 1 print(ans)
[ 7, 15, 0, 13, 4, 13, 0, 13, 4, 13, 13, 4, 13, 2, 2, 4, 13, 13, 17, 2, 18, 13, 17, 17, 10, 4, 13, 10, 4, 13 ]
[ [ 28, 3 ], [ 25, 7 ], [ 29, 10 ], [ 29, 17 ], [ 26, 21 ], [ 25, 26 ], [ 28, 29 ] ]
[ "from collections import Counter\nS = input()\nC = Counter(S)\nprint((len(S)//2)+(C[\"p\"]*(-1)))", "from collections import Counter", "S = input()", "S", "input()", "input", "C = Counter(S)", "C", "Counter(S)", "Counter", "S", "print((len(S)//2)+(C[\"p\"]*(-1)))", "print", "(len(S)//2)+(C[\"p\"]*(-1))", "len(S)//2", "len(S)", "len", "S", "2", "C[\"p\"]*(-1)", "C[\"p\"]", "C", "\"p\"", "-1", "C = Counter(S)", "Counter(S)", "C", "S = input()", "input()", "S" ]
from collections import Counter S = input() C = Counter(S) print((len(S)//2)+(C["p"]*(-1)))
[ 7, 12, 13, 0, 13, 4, 13, 4, 13, 0, 13, 17, 28, 13, 13, 4, 13, 13, 14, 2, 2, 13, 17, 17, 14, 2, 13, 17, 0, 13, 17, 14, 2, 13, 17, 0, 13, 17, 4, 13, 13, 14, 2, 13, 17, 4, 13, 10, 12, 13 ]
[ [ 5, 4 ], [ 11, 10 ], [ 4, 17 ], [ 30, 29 ], [ 37, 36 ], [ 36, 40 ], [ 29, 40 ], [ 10, 40 ], [ 49, 46 ] ]
[ "#!/usr/bin python3\n# -*- coding: utf-8 -*-\n\ndef main():\n S = list(input())\n ret = 0\n for i, a in enumerate(S):\n if i%2==0:\n #jibunnha g\n if a=='p':\n ret -= 1\n else:\n if a=='g':\n ret += 1\n print(ret)\n\nif __name__ == '__main__':\n main()", "def main():\n S = list(input())\n ret = 0\n for i, a in enumerate(S):\n if i%2==0:\n #jibunnha g\n if a=='p':\n ret -= 1\n else:\n if a=='g':\n ret += 1\n print(ret)", "main", "S = list(input())", "S", "list(input())", "list", "input()", "input", "ret = 0", "ret", "0", "for i, a in enumerate(S):\n if i%2==0:\n #jibunnha g\n if a=='p':\n ret -= 1\n else:\n if a=='g':\n ret += 1\n ", "i", "a", "enumerate(S)", "enumerate", "S", "if i%2==0:\n #jibunnha g\n if a=='p':\n ret -= 1\n else:\n if a=='g':\n ret += 1\n ", "i%2==0", "i%2", "i", "2", "0", "if a=='p':\n ret -= 1\n ", "a=='p'", "a", "'p'", "ret -= 1", "ret", "1", "if a=='g':\n ret += 1\n ", "a=='g'", "a", "'g'", "ret += 1", "ret", "1", "print(ret)", "print", "ret", "if __name__ == '__main__':\n main()", "__name__ == '__main__'", "__name__", "'__main__'", "main()", "main", "def main():\n S = list(input())\n ret = 0\n for i, a in enumerate(S):\n if i%2==0:\n #jibunnha g\n if a=='p':\n ret -= 1\n else:\n if a=='g':\n ret += 1\n print(ret)", "def main():\n S = list(input())\n ret = 0\n for i, a in enumerate(S):\n if i%2==0:\n #jibunnha g\n if a=='p':\n ret -= 1\n else:\n if a=='g':\n ret += 1\n print(ret)", "main" ]
#!/usr/bin python3 # -*- coding: utf-8 -*- def main(): S = list(input()) ret = 0 for i, a in enumerate(S): if i%2==0: #jibunnha g if a=='p': ret -= 1 else: if a=='g': ret += 1 print(ret) if __name__ == '__main__': main()
[ 7, 0, 13, 4, 13, 4, 13, 2, 4, 13, 2, 4, 13, 13, 17, 4, 18, 13, 13, 17, 10, 4, 13 ]
[ [ 21, 2 ], [ 22, 13 ], [ 22, 17 ], [ 21, 22 ] ]
[ "s = input()\nprint(int(len(s) / 2) - s.count(\"p\"))", "s = input()", "s", "input()", "input", "print(int(len(s) / 2) - s.count(\"p\"))", "print", "int(len(s) / 2) - s.count(\"p\")", "int(len(s) / 2)", "int", "len(s) / 2", "len(s)", "len", "s", "2", "s.count(\"p\")", "s.count", "s", "count", "\"p\"", "s = input()", "input()", "s" ]
s = input() print(int(len(s) / 2) - s.count("p"))
[ 7, 15, 13, 0, 13, 4, 13, 0, 13, 4, 13, 13, 0, 13, 4, 18, 13, 13, 17, 0, 13, 4, 18, 13, 13, 17, 0, 13, 4, 18, 13, 13, 2, 2, 13, 13, 17, 4, 13, 2, 2, 2, 13, 13, 13, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13 ]
[ [ 56, 4 ], [ 47, 8 ], [ 57, 11 ], [ 53, 13 ], [ 48, 16 ], [ 50, 20 ], [ 48, 23 ], [ 59, 27 ], [ 54, 34 ], [ 51, 35 ], [ 54, 42 ], [ 51, 43 ], [ 60, 44 ], [ 54, 45 ], [ 47, 48 ], [ 50, 51 ], [ 53, 54 ], [ 56, 57 ], [ 59, 60 ] ]
[ "import math\ns = input()\nli = list(s)\na = li.count('p')\nb = li.count('g')\n#print(a,b)\n#1 2\nrisou = math.ceil((a+b)/2)\n#print(risou) 2\nprint(((a+b)-risou)-a)", "import math", "math", "s = input()", "s", "input()", "input", "li = list(s)", "li", "list(s)", "list", "s", "a = li.count('p')", "a", "li.count('p')", "li.count", "li", "count", "'p'", "b = li.count('g')", "b", "li.count('g')", "li.count", "li", "count", "'g'", "risou = math.ceil((a+b)/2)", "risou", "math.ceil((a+b)/2)", "math.ceil", "math", "ceil", "(a+b)/2", "a+b", "a", "b", "2", "print(((a+b)-risou)-a)", "print", "((a+b)-risou)-a", "(a+b)-risou", "a+b", "a", "b", "risou", "a", "li = list(s)", "list(s)", "li", "b = li.count('g')", "li.count('g')", "b", "a = li.count('p')", "li.count('p')", "a", "s = input()", "input()", "s", "risou = math.ceil((a+b)/2)", "math.ceil((a+b)/2)", "risou" ]
import math s = input() li = list(s) a = li.count('p') b = li.count('g') #print(a,b) #1 2 risou = math.ceil((a+b)/2) #print(risou) 2 print(((a+b)-risou)-a)
[ 7, 0, 13, 4, 13, 0, 13, 4, 13, 13, 0, 13, 17, 0, 13, 17, 0, 13, 17, 0, 13, 17, 28, 13, 4, 13, 13, 14, 2, 18, 13, 13, 17, 14, 40, 2, 13, 17, 13, 0, 13, 17, 0, 13, 17, 0, 13, 17, 14, 2, 18, 13, 13, 17, 14, 40, 2, 13, 17, 13, 0, 13, 17, 0, 13, 17, 0, 13, 17, 4, 13, 2, 13, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 4, 13 ]
[ [ 96, 2 ], [ 108, 6 ], [ 97, 9 ], [ 75, 11 ], [ 78, 14 ], [ 99, 17 ], [ 105, 20 ], [ 24, 23 ], [ 109, 26 ], [ 97, 30 ], [ 23, 31 ], [ 76, 36 ], [ 103, 36 ], [ 85, 36 ], [ 79, 38 ], [ 91, 38 ], [ 82, 38 ], [ 84, 40 ], [ 93, 43 ], [ 81, 46 ], [ 97, 51 ], [ 23, 52 ], [ 85, 57 ], [ 76, 57 ], [ 103, 57 ], [ 82, 59 ], [ 79, 59 ], [ 91, 59 ], [ 102, 61 ], [ 90, 64 ], [ 87, 67 ], [ 94, 72 ], [ 100, 72 ], [ 88, 73 ], [ 106, 73 ], [ 75, 76 ], [ 78, 79 ], [ 81, 82 ], [ 84, 85 ], [ 87, 88 ], [ 90, 91 ], [ 93, 94 ], [ 96, 97 ], [ 99, 100 ], [ 102, 103 ], [ 105, 106 ], [ 108, 109 ] ]
[ "s = input()\nN = len(s)\npc = 0\ngc = 0\nwp = 0\nlp = 0\nfor i in range(N):\n if s[i] == \"g\":\n if pc+1 <= gc:\n pc += 1\n wp += 1\n else:\n gc += 1 \n if s[i] == \"p\": \n if pc+1 <= gc:\n pc += 1\n else:\n gc += 1 \n lp += 1\nprint(wp-lp) ", "s = input()", "s", "input()", "input", "N = len(s)", "N", "len(s)", "len", "s", "pc = 0", "pc", "0", "gc = 0", "gc", "0", "wp = 0", "wp", "0", "lp = 0", "lp", "0", "for i in range(N):\n if s[i] == \"g\":\n if pc+1 <= gc:\n pc += 1\n wp += 1\n else:\n gc += 1 \n if s[i] == \"p\": \n if pc+1 <= gc:\n pc += 1\n else:\n gc += 1 \n lp += 1", "i", "range(N)", "range", "N", "if s[i] == \"g\":\n if pc+1 <= gc:\n pc += 1\n wp += 1\n else:\n gc += 1 \n ", "s[i] == \"g\"", "s[i]", "s", "i", "\"g\"", "if pc+1 <= gc:\n pc += 1\n wp += 1\n else:\n gc += 1 \n ", "pc+1 <= gc", "pc+1", "pc", "1", "gc", "pc += 1", "pc", "1", "wp += 1", "wp", "1", "gc += 1", "gc", "1", "if s[i] == \"p\": \n if pc+1 <= gc:\n pc += 1\n else:\n gc += 1 \n lp += 1", "s[i] == \"p\"", "s[i]", "s", "i", "\"p\"", "if pc+1 <= gc:\n pc += 1\n else:\n gc += 1 \n lp += 1", "pc+1 <= gc", "pc+1", "pc", "1", "gc", "pc += 1", "pc", "1", "gc += 1", "gc", "1", "lp += 1", "lp", "1", "print(wp-lp)", "print", "wp-lp", "wp", "lp", "pc = 0", "0", "pc", "gc = 0", "0", "gc", "gc += 1", "1", "gc", "pc += 1", "1", "pc", "lp += 1", "1", "lp", "gc += 1", "1", "gc", "wp += 1", "1", "wp", "s = input()", "input()", "s", "wp = 0", "0", "wp", "pc += 1", "1", "pc", "lp = 0", "0", "lp", "N = len(s)", "len(s)", "N" ]
s = input() N = len(s) pc = 0 gc = 0 wp = 0 lp = 0 for i in range(N): if s[i] == "g": if pc+1 <= gc: pc += 1 wp += 1 else: gc += 1 if s[i] == "p": if pc+1 <= gc: pc += 1 else: gc += 1 lp += 1 print(wp-lp)
[ 7, 12, 13, 29, 4, 13, 4, 13, 12, 13, 29, 4, 13, 13, 4, 18, 4, 13, 13, 12, 13, 29, 4, 13, 4, 13, 13, 4, 18, 4, 13, 13, 12, 13, 29, 4, 13, 4, 18, 4, 13, 13, 12, 13, 29, 4, 13, 4, 13, 4, 13, 23, 13, 12, 13, 41, 28, 13, 4, 13, 13, 4, 4, 13, 4, 13, 13, 4, 18, 4, 13, 13, 29, 4, 13, 13, 23, 13, 12, 13, 14, 2, 13, 17, 23, 13, 23, 13, 23, 13, 12, 13, 0, 13, 4, 13, 0, 13, 17, 0, 13, 17, 0, 13, 39, 17, 0, 13, 17, 28, 13, 4, 13, 17, 4, 13, 13, 14, 2, 18, 13, 13, 17, 14, 40, 2, 13, 17, 13, 4, 18, 13, 13, 17, 0, 13, 17, 0, 13, 17, 4, 18, 13, 13, 17, 0, 13, 17, 14, 40, 2, 13, 17, 13, 4, 18, 13, 13, 17, 0, 13, 17, 4, 18, 13, 13, 17, 0, 13, 17, 0, 13, 17, 4, 13, 13, 14, 2, 13, 17, 4, 13, 10, 12, 13, 10, 12, 13, 10, 12, 13, 10, 12, 13, 10, 12, 13, 10, 12, 13, 10, 12, 13, 10, 12, 13 ]
[ [ 52, 52 ], [ 58, 57 ], [ 77, 60 ], [ 77, 77 ], [ 89, 82 ], [ 85, 85 ], [ 87, 87 ], [ 89, 89 ], [ 94, 93 ], [ 98, 97 ], [ 101, 100 ], [ 104, 103 ], [ 108, 107 ], [ 111, 110 ], [ 93, 116 ], [ 93, 120 ], [ 110, 121 ], [ 100, 126 ], [ 160, 126 ], [ 135, 126 ], [ 97, 128 ], [ 168, 128 ], [ 146, 128 ], [ 103, 131 ], [ 136, 135 ], [ 139, 138 ], [ 103, 142 ], [ 147, 146 ], [ 100, 151 ], [ 160, 151 ], [ 135, 151 ], [ 97, 153 ], [ 168, 153 ], [ 146, 153 ], [ 103, 156 ], [ 161, 160 ], [ 103, 164 ], [ 169, 168 ], [ 172, 171 ], [ 171, 175 ], [ 138, 175 ], [ 107, 175 ], [ 205, 181 ] ]
[ "def inp(): # n=1\n return int(input())\ndef inpm(): # x=1,y=2\n return map(int,input().split())\ndef inpl(): # a=[1,2,3,4,5,...,n]\n return list(map(int, input().split()))\ndef inpls(): # a=['1','2','3',...,'n']\n return list(input().split())\ndef inplm(n): # x=[] 複数行\n return list(int(input()) for _ in range(n))\ndef inpll(n): # [[1,1,1,1],[2,2,2,2],[3,3,3,3]]\n return sorted([list(map(int, input().split())) for _ in range(n)])\ndef sortx(x,n,k):\n if k == 0:x.sort(key=lambda y:y[1,n])\n else:x.sort(reversed=True, key=lambda y:y[1,n])\n\ndef main():\n s = input()\n NG = 1\n NP = 0\n did = [\"g\"]\n point = 0\n for i in range(1,len(s)):\n if s[i] == \"g\":\n if NP + 1 <= NG:\n did.append(\"p\")\n NP += 1\n point += 1\n else:\n did.append(\"g\")\n NG += 1\n else:\n if NP + 1 <= NG:\n did.append(\"p\")\n NP += 1\n else:\n did.append(\"g\")\n NG += 1\n point -= 1\n print(point)\n\nif __name__ == \"__main__\":\n main()", "def inp(): # n=1\n return int(input())", "inp", "return int(input())", "int(input())", "int", "input()", "input", "def inpm(): # x=1,y=2\n return map(int,input().split())", "inpm", "return map(int,input().split())", "map(int,input().split())", "map", "int", "input().split()", "().split", "()", "input", "split", "def inpl(): # a=[1,2,3,4,5,...,n]\n return list(map(int, input().split()))", "inpl", "return list(map(int, input().split()))", "list(map(int, input().split()))", "list", "map(int, input().split())", "map", "int", "input().split()", "().split", "()", "input", "split", "def inpls(): # a=['1','2','3',...,'n']\n return list(input().split())", "inpls", "return list(input().split())", "list(input().split())", "list", "input().split()", "().split", "()", "input", "split", "def inplm(n): # x=[] 複数行\n return list(int(input()) for _ in range(n))", "inplm", "return list(int(input()) for _ in range(n))", "list(int(input()) for _ in range(n))", "list", "int(input())", "int", "input()", "input", "n", "n", "def inpll(n): # [[1,1,1,1],[2,2,2,2],[3,3,3,3]]\n return sorted([list(map(int, input().split())) for _ in range(n)])", "inpll", "list(map(int, input().split())) for _ in range(n)", "for _ in range(n)", "_", "range(n)", "range", "n", "for _ in range(n)", "list(map(int, input().split()))", "list", "map(int, input().split())", "map", "int", "input().split()", "().split", "()", "input", "split", "return sorted([list(map(int, input().split())) for _ in range(n)])", "sorted([list(map(int, input().split())) for _ in range(n)])", "sorted", "[list(map(int, input().split())) for _ in range(n)]", "n", "n", "def sortx(x,n,k):\n if k == 0:x.sort(key=lambda y:y[1,n])\n else:x.sort(reversed=True, key=lambda y:y[1,n])", "sortx", "if k == 0:x.sort(key=lambda y:y[1,n])\n else:x.sort(reversed=True, key=lambda y:y[1,n])", "k == 0", "k", "0", "x", "x", "n", "n", "k", "k", "def main():\n s = input()\n NG = 1\n NP = 0\n did = [\"g\"]\n point = 0\n for i in range(1,len(s)):\n if s[i] == \"g\":\n if NP + 1 <= NG:\n did.append(\"p\")\n NP += 1\n point += 1\n else:\n did.append(\"g\")\n NG += 1\n else:\n if NP + 1 <= NG:\n did.append(\"p\")\n NP += 1\n else:\n did.append(\"g\")\n NG += 1\n point -= 1\n print(point)", "main", "s = input()", "s", "input()", "input", "NG = 1", "NG", "1", "NP = 0", "NP", "0", "did = [\"g\"]", "did", "[\"g\"]", "\"g\"", "point = 0", "point", "0", "for i in range(1,len(s)):\n if s[i] == \"g\":\n if NP + 1 <= NG:\n did.append(\"p\")\n NP += 1\n point += 1\n else:\n did.append(\"g\")\n NG += 1\n else:\n if NP + 1 <= NG:\n did.append(\"p\")\n NP += 1\n else:\n did.append(\"g\")\n NG += 1\n point -= 1\n ", "i", "range(1,len(s))", "range", "1", "len(s)", "len", "s", "if s[i] == \"g\":\n if NP + 1 <= NG:\n did.append(\"p\")\n NP += 1\n point += 1\n else:\n did.append(\"g\")\n NG += 1\n else:\n if NP + 1 <= NG:\n did.append(\"p\")\n NP += 1\n else:\n did.append(\"g\")\n NG += 1\n point -= 1\n ", "s[i] == \"g\"", "s[i]", "s", "i", "\"g\"", "if NP + 1 <= NG:\n did.append(\"p\")\n NP += 1\n point += 1\n else:\n did.append(\"g\")\n NG += 1\n ", "NP + 1 <= NG", "NP + 1", "NP", "1", "NG", "did.append(\"p\")", "did.append", "did", "append", "\"p\"", "NP += 1", "NP", "1", "point += 1", "point", "1", "did.append(\"g\")", "did.append", "did", "append", "\"g\"", "NG += 1", "NG", "1", "if NP + 1 <= NG:\n did.append(\"p\")\n NP += 1\n else:\n did.append(\"g\")\n NG += 1\n point -= 1\n ", "NP + 1 <= NG", "NP + 1", "NP", "1", "NG", "did.append(\"p\")", "did.append", "did", "append", "\"p\"", "NP += 1", "NP", "1", "did.append(\"g\")", "did.append", "did", "append", "\"g\"", "NG += 1", "NG", "1", "point -= 1", "point", "1", "print(point)", "print", "point", "if __name__ == \"__main__\":\n main()", "__name__ == \"__main__\"", "__name__", "\"__main__\"", "main()", "main", "def inplm(n): # x=[] 複数行\n return list(int(input()) for _ in range(n))", "def inplm(n): # x=[] 複数行\n return list(int(input()) for _ in range(n))", "inplm", "def inpl(): # a=[1,2,3,4,5,...,n]\n return list(map(int, input().split()))", "def inpl(): # a=[1,2,3,4,5,...,n]\n return list(map(int, input().split()))", "inpl", "def inpm(): # x=1,y=2\n return map(int,input().split())", "def inpm(): # x=1,y=2\n return map(int,input().split())", "inpm", "def inpll(n): # [[1,1,1,1],[2,2,2,2],[3,3,3,3]]\n return sorted([list(map(int, input().split())) for _ in range(n)])", "def inpll(n): # [[1,1,1,1],[2,2,2,2],[3,3,3,3]]\n return sorted([list(map(int, input().split())) for _ in range(n)])", "inpll", "def inp(): # n=1\n return int(input())", "def inp(): # n=1\n return int(input())", "inp", "def sortx(x,n,k):\n if k == 0:x.sort(key=lambda y:y[1,n])\n else:x.sort(reversed=True, key=lambda y:y[1,n])", "def sortx(x,n,k):\n if k == 0:x.sort(key=lambda y:y[1,n])\n else:x.sort(reversed=True, key=lambda y:y[1,n])", "sortx", "def inpls(): # a=['1','2','3',...,'n']\n return list(input().split())", "def inpls(): # a=['1','2','3',...,'n']\n return list(input().split())", "inpls", "def main():\n s = input()\n NG = 1\n NP = 0\n did = [\"g\"]\n point = 0\n for i in range(1,len(s)):\n if s[i] == \"g\":\n if NP + 1 <= NG:\n did.append(\"p\")\n NP += 1\n point += 1\n else:\n did.append(\"g\")\n NG += 1\n else:\n if NP + 1 <= NG:\n did.append(\"p\")\n NP += 1\n else:\n did.append(\"g\")\n NG += 1\n point -= 1\n print(point)", "def main():\n s = input()\n NG = 1\n NP = 0\n did = [\"g\"]\n point = 0\n for i in range(1,len(s)):\n if s[i] == \"g\":\n if NP + 1 <= NG:\n did.append(\"p\")\n NP += 1\n point += 1\n else:\n did.append(\"g\")\n NG += 1\n else:\n if NP + 1 <= NG:\n did.append(\"p\")\n NP += 1\n else:\n did.append(\"g\")\n NG += 1\n point -= 1\n print(point)", "main" ]
def inp(): # n=1 return int(input()) def inpm(): # x=1,y=2 return map(int,input().split()) def inpl(): # a=[1,2,3,4,5,...,n] return list(map(int, input().split())) def inpls(): # a=['1','2','3',...,'n'] return list(input().split()) def inplm(n): # x=[] 複数行 return list(int(input()) for _ in range(n)) def inpll(n): # [[1,1,1,1],[2,2,2,2],[3,3,3,3]] return sorted([list(map(int, input().split())) for _ in range(n)]) def sortx(x,n,k): if k == 0:x.sort(key=lambda y:y[1,n]) else:x.sort(reversed=True, key=lambda y:y[1,n]) def main(): s = input() NG = 1 NP = 0 did = ["g"] point = 0 for i in range(1,len(s)): if s[i] == "g": if NP + 1 <= NG: did.append("p") NP += 1 point += 1 else: did.append("g") NG += 1 else: if NP + 1 <= NG: did.append("p") NP += 1 else: did.append("g") NG += 1 point -= 1 print(point) if __name__ == "__main__": main()
[ 7, 0, 13, 4, 13, 0, 13, 4, 13, 13, 0, 13, 17, 0, 13, 17, 0, 13, 17, 28, 13, 4, 13, 13, 14, 2, 13, 13, 14, 2, 18, 13, 13, 17, 0, 13, 17, 0, 13, 17, 0, 13, 17, 14, 2, 13, 13, 14, 2, 18, 13, 13, 17, 0, 13, 17, 0, 13, 17, 0, 13, 17, 4, 13, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13 ]
[ [ 69, 2 ], [ 87, 6 ], [ 70, 9 ], [ 72, 11 ], [ 66, 14 ], [ 81, 17 ], [ 21, 20 ], [ 88, 23 ], [ 73, 26 ], [ 91, 26 ], [ 85, 26 ], [ 67, 27 ], [ 97, 27 ], [ 94, 27 ], [ 70, 31 ], [ 20, 32 ], [ 93, 35 ], [ 75, 38 ], [ 96, 41 ], [ 73, 45 ], [ 91, 45 ], [ 85, 45 ], [ 67, 46 ], [ 97, 46 ], [ 94, 46 ], [ 70, 50 ], [ 20, 51 ], [ 84, 54 ], [ 90, 57 ], [ 78, 60 ], [ 79, 64 ], [ 76, 64 ], [ 82, 64 ], [ 66, 67 ], [ 69, 70 ], [ 72, 73 ], [ 75, 76 ], [ 78, 79 ], [ 81, 82 ], [ 84, 85 ], [ 87, 88 ], [ 90, 91 ], [ 93, 94 ], [ 96, 97 ] ]
[ "s = input()\nN = len(s)\n\ng = 0\np = 0\nscore = 0\n\nfor i in range(N):\n if(g > p):\n if(s[i] == \"g\"):\n p += 1\n score += 1\n else:\n p += 1\n elif(g == p):\n if(s[i] == \"g\"):\n g += 1\n else:\n g += 1\n score -= 1\nprint(score) ", "s = input()", "s", "input()", "input", "N = len(s)", "N", "len(s)", "len", "s", "g = 0", "g", "0", "p = 0", "p", "0", "score = 0", "score", "0", "for i in range(N):\n if(g > p):\n if(s[i] == \"g\"):\n p += 1\n score += 1\n else:\n p += 1\n elif(g == p):\n if(s[i] == \"g\"):\n g += 1\n else:\n g += 1\n score -= 1", "i", "range(N)", "range", "N", "if(g > p):\n if(s[i] == \"g\"):\n p += 1\n score += 1\n else:\n p += 1\n elif(g == p):\n if(s[i] == \"g\"):\n g += 1\n else:\n g += 1\n score -= 1", "g > p", "g", "p", "if(s[i] == \"g\"):\n p += 1\n score += 1\n else:\n p += 1\n ", "s[i] == \"g\"", "s[i]", "s", "i", "\"g\"", "p += 1", "p", "1", "score += 1", "score", "1", "p += 1", "p", "1", "elif(g == p):\n if(s[i] == \"g\"):\n g += 1\n else:\n g += 1\n score -= 1", "g == p", "g", "p", "if(s[i] == \"g\"):\n g += 1\n else:\n g += 1\n score -= 1", "s[i] == \"g\"", "s[i]", "s", "i", "\"g\"", "g += 1", "g", "1", "g += 1", "g", "1", "score -= 1", "score", "1", "print(score)", "print", "score", "p = 0", "0", "p", "s = input()", "input()", "s", "g = 0", "0", "g", "score += 1", "1", "score", "score -= 1", "1", "score", "score = 0", "0", "score", "g += 1", "1", "g", "N = len(s)", "len(s)", "N", "g += 1", "1", "g", "p += 1", "1", "p", "p += 1", "1", "p" ]
s = input() N = len(s) g = 0 p = 0 score = 0 for i in range(N): if(g > p): if(s[i] == "g"): p += 1 score += 1 else: p += 1 elif(g == p): if(s[i] == "g"): g += 1 else: g += 1 score -= 1 print(score)
[ 7, 0, 13, 4, 13, 0, 13, 4, 18, 13, 13, 17, 0, 13, 4, 18, 13, 13, 17, 4, 13, 2, 2, 13, 13, 17, 10, 4, 13, 10, 4, 13, 10, 4, 13 ]
[ [ 30, 2 ], [ 27, 6 ], [ 31, 9 ], [ 33, 13 ], [ 31, 16 ], [ 28, 23 ], [ 34, 24 ], [ 27, 28 ], [ 30, 31 ], [ 33, 34 ] ]
[ "s=input()\ng = s.count('g')\np = s.count('p')\n\nprint((g-p)//2)", "s=input()", "s", "input()", "input", "g = s.count('g')", "g", "s.count('g')", "s.count", "s", "count", "'g'", "p = s.count('p')", "p", "s.count('p')", "s.count", "s", "count", "'p'", "print((g-p)//2)", "print", "(g-p)//2", "g-p", "g", "p", "2", "g = s.count('g')", "s.count('g')", "g", "s=input()", "input()", "s", "p = s.count('p')", "s.count('p')", "p" ]
s=input() g = s.count('g') p = s.count('p') print((g-p)//2)
[ 7, 12, 13, 0, 13, 4, 13, 29, 13, 12, 13, 0, 13, 4, 13, 0, 13, 17, 0, 13, 39, 28, 13, 13, 14, 2, 13, 17, 4, 18, 13, 13, 17, 0, 13, 17, 9, 14, 2, 13, 17, 14, 2, 13, 17, 4, 18, 13, 13, 17, 0, 13, 17, 9, 4, 18, 13, 13, 17, 0, 13, 17, 9, 14, 2, 13, 17, 4, 18, 13, 13, 17, 0, 13, 17, 9, 4, 18, 13, 13, 17, 0, 13, 17, 9, 0, 13, 17, 0, 13, 17, 28, 13, 13, 4, 13, 13, 13, 14, 2, 13, 13, 9, 14, 2, 13, 17, 0, 13, 17, 0, 13, 17, 4, 13, 2, 13, 13, 14, 2, 13, 17, 4, 13, 10, 12, 13, 10, 12, 13 ]
[ [ 5, 4 ], [ 4, 8 ], [ 13, 12 ], [ 129, 14 ], [ 17, 16 ], [ 20, 19 ], [ 23, 22 ], [ 12, 22 ], [ 16, 26 ], [ 82, 26 ], [ 73, 26 ], [ 60, 26 ], [ 51, 26 ], [ 34, 26 ], [ 19, 30 ], [ 35, 34 ], [ 22, 39 ], [ 34, 43 ], [ 16, 43 ], [ 82, 43 ], [ 73, 43 ], [ 60, 43 ], [ 51, 43 ], [ 19, 47 ], [ 52, 51 ], [ 19, 56 ], [ 61, 60 ], [ 34, 65 ], [ 16, 65 ], [ 82, 65 ], [ 73, 65 ], [ 60, 65 ], [ 51, 65 ], [ 19, 69 ], [ 74, 73 ], [ 19, 78 ], [ 83, 82 ], [ 87, 86 ], [ 90, 89 ], [ 19, 96 ], [ 12, 97 ], [ 109, 108 ], [ 112, 111 ], [ 111, 116 ], [ 86, 116 ], [ 108, 117 ], [ 89, 117 ], [ 126, 123 ] ]
[ "\n\ndef read_input():\n s = input()\n return s\n\ndef submit():\n s = read_input()\n\n p_card = 0\n hands = []\n for c in s:\n if p_card == 0:\n hands.append('g')\n p_card += 1\n continue\n\n if c == 'p':\n if p_card > 0:\n hands.append('p')\n p_card -= 1\n continue\n else:\n hands.append('g')\n p_card += 1\n continue\n else:\n if p_card > 0:\n hands.append('p')\n p_card -= 1\n continue\n else:\n hands.append('g')\n p_card += 1\n continue\n\n win = 0\n loose = 0\n for a,t in zip(hands, s):\n if a == t:\n continue\n\n if a == 'g':\n loose += 1\n else:\n win += 1\n\n print(win - loose)\n\n\n\nif __name__ == '__main__':\n submit()", "def read_input():\n s = input()\n return s", "read_input", "s = input()", "s", "input()", "input", "return s", "s", "def submit():\n s = read_input()\n\n p_card = 0\n hands = []\n for c in s:\n if p_card == 0:\n hands.append('g')\n p_card += 1\n continue\n\n if c == 'p':\n if p_card > 0:\n hands.append('p')\n p_card -= 1\n continue\n else:\n hands.append('g')\n p_card += 1\n continue\n else:\n if p_card > 0:\n hands.append('p')\n p_card -= 1\n continue\n else:\n hands.append('g')\n p_card += 1\n continue\n\n win = 0\n loose = 0\n for a,t in zip(hands, s):\n if a == t:\n continue\n\n if a == 'g':\n loose += 1\n else:\n win += 1\n\n print(win - loose)", "submit", "s = read_input()", "s", "read_input()", "read_input", "p_card = 0", "p_card", "0", "hands = []", "hands", "[]", "for c in s:\n if p_card == 0:\n hands.append('g')\n p_card += 1\n continue\n\n if c == 'p':\n if p_card > 0:\n hands.append('p')\n p_card -= 1\n continue\n else:\n hands.append('g')\n p_card += 1\n continue\n else:\n if p_card > 0:\n hands.append('p')\n p_card -= 1\n continue\n else:\n hands.append('g')\n p_card += 1\n continue\n\n ", "c", "s", "if p_card == 0:\n hands.append('g')\n p_card += 1\n continue\n\n ", "p_card == 0", "p_card", "0", "hands.append('g')", "hands.append", "hands", "append", "'g'", "p_card += 1", "p_card", "1", "continue", "if c == 'p':\n if p_card > 0:\n hands.append('p')\n p_card -= 1\n continue\n else:\n hands.append('g')\n p_card += 1\n continue\n else:\n if p_card > 0:\n hands.append('p')\n p_card -= 1\n continue\n else:\n hands.append('g')\n p_card += 1\n continue\n\n ", "c == 'p'", "c", "'p'", "if p_card > 0:\n hands.append('p')\n p_card -= 1\n continue\n else:\n hands.append('g')\n p_card += 1\n continue\n ", "p_card > 0", "p_card", "0", "hands.append('p')", "hands.append", "hands", "append", "'p'", "p_card -= 1", "p_card", "1", "continue", "hands.append('g')", "hands.append", "hands", "append", "'g'", "p_card += 1", "p_card", "1", "continue", "if p_card > 0:\n hands.append('p')\n p_card -= 1\n continue\n else:\n hands.append('g')\n p_card += 1\n continue\n\n ", "p_card > 0", "p_card", "0", "hands.append('p')", "hands.append", "hands", "append", "'p'", "p_card -= 1", "p_card", "1", "continue", "hands.append('g')", "hands.append", "hands", "append", "'g'", "p_card += 1", "p_card", "1", "continue", "win = 0", "win", "0", "loose = 0", "loose", "0", "for a,t in zip(hands, s):\n if a == t:\n continue\n\n if a == 'g':\n loose += 1\n else:\n win += 1\n\n ", "a", "t", "zip(hands, s)", "zip", "hands", "s", "if a == t:\n continue\n\n ", "a == t", "a", "t", "continue", "if a == 'g':\n loose += 1\n else:\n win += 1\n\n ", "a == 'g'", "a", "'g'", "loose += 1", "loose", "1", "win += 1", "win", "1", "print(win - loose)", "print", "win - loose", "win", "loose", "if __name__ == '__main__':\n submit()", "__name__ == '__main__'", "__name__", "'__main__'", "submit()", "submit", "def submit():\n s = read_input()\n\n p_card = 0\n hands = []\n for c in s:\n if p_card == 0:\n hands.append('g')\n p_card += 1\n continue\n\n if c == 'p':\n if p_card > 0:\n hands.append('p')\n p_card -= 1\n continue\n else:\n hands.append('g')\n p_card += 1\n continue\n else:\n if p_card > 0:\n hands.append('p')\n p_card -= 1\n continue\n else:\n hands.append('g')\n p_card += 1\n continue\n\n win = 0\n loose = 0\n for a,t in zip(hands, s):\n if a == t:\n continue\n\n if a == 'g':\n loose += 1\n else:\n win += 1\n\n print(win - loose)", "def submit():\n s = read_input()\n\n p_card = 0\n hands = []\n for c in s:\n if p_card == 0:\n hands.append('g')\n p_card += 1\n continue\n\n if c == 'p':\n if p_card > 0:\n hands.append('p')\n p_card -= 1\n continue\n else:\n hands.append('g')\n p_card += 1\n continue\n else:\n if p_card > 0:\n hands.append('p')\n p_card -= 1\n continue\n else:\n hands.append('g')\n p_card += 1\n continue\n\n win = 0\n loose = 0\n for a,t in zip(hands, s):\n if a == t:\n continue\n\n if a == 'g':\n loose += 1\n else:\n win += 1\n\n print(win - loose)", "submit", "def read_input():\n s = input()\n return s", "def read_input():\n s = input()\n return s", "read_input" ]
def read_input(): s = input() return s def submit(): s = read_input() p_card = 0 hands = [] for c in s: if p_card == 0: hands.append('g') p_card += 1 continue if c == 'p': if p_card > 0: hands.append('p') p_card -= 1 continue else: hands.append('g') p_card += 1 continue else: if p_card > 0: hands.append('p') p_card -= 1 continue else: hands.append('g') p_card += 1 continue win = 0 loose = 0 for a,t in zip(hands, s): if a == t: continue if a == 'g': loose += 1 else: win += 1 print(win - loose) if __name__ == '__main__': submit()
[ 7, 0, 13, 4, 13, 4, 13, 2, 2, 4, 13, 13, 17, 4, 18, 13, 13, 17, 10, 4, 13 ]
[ [ 19, 2 ], [ 20, 11 ], [ 20, 15 ], [ 19, 20 ] ]
[ "i=input();print(len(i)//2-i.count('p'))", "i=input()", "i", "input()", "input", "print(len(i)//2-i.count('p'))", "print", "len(i)//2-i.count('p')", "len(i)//2", "len(i)", "len", "i", "2", "i.count('p')", "i.count", "i", "count", "'p'", "i=input()", "input()", "i" ]
i=input();print(len(i)//2-i.count('p'))
[ 7, 15, 13, 0, 13, 18, 18, 13, 13, 13, 0, 13, 4, 18, 4, 13, 13, 0, 13, 17, 28, 13, 4, 13, 4, 13, 13, 14, 2, 2, 13, 17, 17, 14, 2, 18, 13, 13, 17, 0, 13, 17, 14, 2, 2, 13, 17, 17, 14, 2, 18, 13, 13, 17, 0, 13, 17, 4, 13, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13, 10, 18, 13, 10, 17, 13 ]
[ [ 70, 4 ], [ 64, 11 ], [ 71, 15 ], [ 67, 18 ], [ 22, 21 ], [ 65, 26 ], [ 21, 30 ], [ 65, 36 ], [ 21, 37 ], [ 73, 40 ], [ 21, 45 ], [ 65, 51 ], [ 21, 52 ], [ 61, 55 ], [ 62, 59 ], [ 74, 59 ], [ 68, 59 ], [ 61, 62 ], [ 64, 65 ], [ 67, 68 ], [ 70, 71 ], [ 73, 74 ] ]
[ "import sys\nreadline = sys.stdin.readline\n\nS = readline().rstrip()\n\n# パーを出せるときは必ずパーを出すのが最善\n# g p g pの順で出せばよい\n# 相手の手が、\n# i % 2 == 0のとき\n# gであれば0、pであれば-1\n# i % 2 == 1のとき\n# gであれば+1、pであれば0\n\nans = 0\nfor i in range(len(S)):\n if i % 2 == 0:\n if S[i] == \"p\":\n ans -= 1\n elif i % 2 == 1:\n if S[i] == \"g\":\n ans += 1\n \nprint(ans)", "import sys", "sys", "readline = sys.stdin.readline", "readline", "sys.stdin.readline", "sys.stdin", "sys", "stdin", "readline", "S = readline().rstrip()", "S", "readline().rstrip()", "().rstrip", "()", "readline", "rstrip", "ans = 0", "ans", "0", "for i in range(len(S)):\n if i % 2 == 0:\n if S[i] == \"p\":\n ans -= 1\n elif i % 2 == 1:\n if S[i] == \"g\":\n ans += 1\n ", "i", "range(len(S))", "range", "len(S)", "len", "S", "if i % 2 == 0:\n if S[i] == \"p\":\n ans -= 1\n elif i % 2 == 1:\n if S[i] == \"g\":\n ans += 1\n ", "i % 2 == 0", "i % 2", "i", "2", "0", "if S[i] == \"p\":\n ans -= 1\n ", "S[i] == \"p\"", "S[i]", "S", "i", "\"p\"", "ans -= 1", "ans", "1", "elif i % 2 == 1:\n if S[i] == \"g\":\n ans += 1\n ", "i % 2 == 1", "i % 2", "i", "2", "1", "if S[i] == \"g\":\n ans += 1\n ", "S[i] == \"g\"", "S[i]", "S", "i", "\"g\"", "ans += 1", "ans", "1", "print(ans)", "print", "ans", "ans += 1", "1", "ans", "S = readline().rstrip()", "readline().rstrip()", "S", "ans = 0", "0", "ans", "readline = sys.stdin.readline", "sys.stdin.readline", "readline", "ans -= 1", "1", "ans" ]
import sys readline = sys.stdin.readline S = readline().rstrip() # パーを出せるときは必ずパーを出すのが最善 # g p g pの順で出せばよい # 相手の手が、 # i % 2 == 0のとき # gであれば0、pであれば-1 # i % 2 == 1のとき # gであれば+1、pであれば0 ans = 0 for i in range(len(S)): if i % 2 == 0: if S[i] == "p": ans -= 1 elif i % 2 == 1: if S[i] == "g": ans += 1 print(ans)
[ 7, 17, 12, 13, 41, 28, 13, 4, 18, 4, 13, 13, 4, 4, 13, 13, 12, 13, 12, 13, 23, 13, 41, 28, 13, 4, 13, 13, 4, 4, 13, 4, 13, 12, 13, 23, 13, 12, 13, 0, 13, 39, 28, 13, 4, 13, 13, 4, 18, 13, 13, 4, 13, 29, 13, 23, 13, 12, 13, 23, 13, 23, 13, 41, 28, 13, 4, 13, 17, 4, 4, 13, 2, 13, 4, 13, 17, 0, 13, 13, 41, 28, 13, 4, 13, 17, 4, 4, 13, 2, 13, 4, 13, 17, 0, 13, 13, 12, 13, 41, 14, 13, 14, 40, 13, 17, 4, 13, 13, 17, 0, 13, 17, 4, 13, 13, 29, 13, 23, 13, 23, 13, 17, 12, 13, 0, 13, 4, 13, 4, 13, 13, 0, 13, 17, 0, 13, 17, 0, 13, 17, 0, 13, 17, 0, 13, 17, 0, 13, 17, 28, 13, 4, 13, 4, 13, 13, 14, 2, 13, 13, 0, 13, 13, 0, 13, 17, 0, 13, 13, 0, 13, 17, 14, 2, 2, 13, 13, 2, 18, 13, 13, 13, 0, 13, 17, 14, 2, 2, 13, 13, 2, 18, 13, 13, 13, 0, 13, 17, 0, 13, 13, 4, 13, 13, 17, 4, 13, 13, 29, 13, 0, 13, 17, 0, 13, 4, 13, 4, 13, 13, 17, 10, 13, 13, 10, 12, 13, 10, 12, 13, 10, 12, 13, 10, 13, 13, 10, 12, 13, 10, 12, 13, 10, 4, 13, 10, 12, 13, 10, 12, 13, 10, 12, 13, 10, 17, 13 ]
[ [ 7, 6 ], [ 6, 15 ], [ 21, 21 ], [ 25, 24 ], [ 36, 36 ], [ 41, 40 ], [ 44, 43 ], [ 56, 46 ], [ 40, 49 ], [ 242, 52 ], [ 40, 54 ], [ 56, 56 ], [ 60, 60 ], [ 62, 62 ], [ 66, 65 ], [ 65, 73 ], [ 223, 78 ], [ 83, 82 ], [ 82, 90 ], [ 235, 95 ], [ 121, 104 ], [ 121, 108 ], [ 112, 111 ], [ 119, 115 ], [ 119, 117 ], [ 119, 119 ], [ 122, 121 ], [ 127, 126 ], [ 254, 130 ], [ 126, 131 ], [ 134, 133 ], [ 137, 136 ], [ 140, 139 ], [ 143, 142 ], [ 146, 145 ], [ 149, 148 ], [ 152, 151 ], [ 126, 156 ], [ 142, 159 ], [ 165, 159 ], [ 139, 160 ], [ 171, 160 ], [ 163, 162 ], [ 136, 163 ], [ 166, 165 ], [ 169, 168 ], [ 133, 169 ], [ 172, 171 ], [ 168, 176 ], [ 162, 176 ], [ 133, 177 ], [ 126, 180 ], [ 151, 181 ], [ 136, 182 ], [ 185, 184 ], [ 168, 189 ], [ 162, 189 ], [ 136, 190 ], [ 126, 193 ], [ 151, 194 ], [ 133, 195 ], [ 198, 197 ], [ 201, 200 ], [ 168, 201 ], [ 162, 201 ], [ 254, 203 ], [ 200, 204 ], [ 148, 204 ], [ 254, 207 ], [ 197, 208 ], [ 184, 208 ], [ 145, 208 ], [ 197, 210 ], [ 184, 210 ], [ 145, 210 ], [ 256, 212 ], [ 244, 215 ], [ 233, 217 ], [ 245, 220 ], [ 223, 224 ], [ 235, 236 ], [ 244, 245 ], [ 256, 257 ] ]
[ "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n\"\"\"\nCreated on 2019/2/\nSolved on 2019/2/\n@author: shinjisu\n\"\"\"\n\n\n# ARC 062 C AtCoDeer and Rock-Paper\ndef getInt(): return int(input())\n\n\ndef getIntList(): return [int(x) for x in input().split()]\n\n\ndef zeros(n): return [0]*n\n\n\ndef getIntLines(n): return [int(input()) for i in range(n)]\n\n\ndef getIntMat(n):\n mat = []\n for i in range(n):\n mat.append(getIntList())\n return mat\n\n\ndef zeros2(n, m): return [zeros(m)]*n\n\n\nALPHABET = [chr(i+ord('a')) for i in range(26)]\nDIGIT = [chr(i+ord('0')) for i in range(10)]\n\n\ndef dmp(x, cmt=''):\n global debug\n if debug:\n if cmt != '':\n print(cmt, ': ', end='')\n print(x)\n return x\n\n\ndef probC():\n S = input()\n dmp(S)\n GU = 'g'\n PA = 'p'\n guCount = 0\n paCount = 0\n point = 0\n allTe = ''\n for i in range(len(S)):\n if paCount < guCount:\n te = PA\n paCount += 1\n else:\n te = GU\n guCount += 1\n\n if te == GU and S[i] == PA:\n point -= 1\n elif te == PA and S[i] == GU:\n point += 1\n allTe += te\n dmp(allTe,'allTe')\n dmp(point)\n return point\n\n\ndebug = False # True False\nans = probC()\nprint(ans)\n#for row in ans:\n# print(row)\n\n\"\"\"\n if S[i] == GU:\n if paCount < guCount:\n te = PA\n paCount += 1\n else:\n te = GU\n guCount += 1\n else:\n if paCount < guCount:\n te = PA\n paCount += 1\n else:\n te = GU\n guCount += 1\n\"\"\"", "\"\"\"\nCreated on 2019/2/\nSolved on 2019/2/\n@author: shinjisu\n\"\"\"", "def getInt(): return int(input())", "getInt", "int(x) for x in input().split()", "for x in input().split()", "x", "input().split()", "().split", "()", "input", "split", "for x in input().split()", "int(x)", "int", "x", "def getIntList(): return [int(x) for x in input().split()]", "getIntList", "def zeros(n): return [0]*n", "zeros", "n", "n", "int(input()) for i in range(n)", "for i in range(n)", "i", "range(n)", "range", "n", "for i in range(n)", "int(input())", "int", "input()", "input", "def getIntLines(n): return [int(input()) for i in range(n)]", "getIntLines", "n", "n", "def getIntMat(n):\n mat = []\n for i in range(n):\n mat.append(getIntList())\n return mat", "getIntMat", "mat = []", "mat", "[]", "for i in range(n):\n mat.append(getIntList())\n ", "i", "range(n)", "range", "n", "mat.append(getIntList())", "mat.append", "mat", "append", "getIntList()", "getIntList", "return mat", "mat", "n", "n", "def zeros2(n, m): return [zeros(m)]*n", "zeros2", "n", "n", "m", "m", "chr(i+ord('a')) for i in range(26)", "for i in range(26)", "i", "range(26)", "range", "26", "for i in range(26)", "chr(i+ord('a'))", "chr", "i+ord('a')", "i", "ord('a')", "ord", "'a'", "ALPHABET = [chr(i+ord('a')) for i in range(26)]", "ALPHABET", "[chr(i+ord('a')) for i in range(26)]", "chr(i+ord('0')) for i in range(10)", "for i in range(10)", "i", "range(10)", "range", "10", "for i in range(10)", "chr(i+ord('0'))", "chr", "i+ord('0')", "i", "ord('0')", "ord", "'0'", "DIGIT = [chr(i+ord('0')) for i in range(10)]", "DIGIT", "[chr(i+ord('0')) for i in range(10)]", "def dmp(x, cmt=''):\n global debug\n if debug:\n if cmt != '':\n print(cmt, ': ', end='')\n print(x)\n return x", "dmp", "global debug", "if debug:\n if cmt != '':\n print(cmt, ': ', end='')\n print(x)\n ", "debug", "if cmt != '':\n print(cmt, ': ', end='')\n ", "cmt != ''", "cmt", "''", "print(cmt, ': ', end='')", "print", "cmt", "': '", "end=''", "end", "''", "print(x)", "print", "x", "return x", "x", "x", "x", "cmt=''", "cmt", "''", "def probC():\n S = input()\n dmp(S)\n GU = 'g'\n PA = 'p'\n guCount = 0\n paCount = 0\n point = 0\n allTe = ''\n for i in range(len(S)):\n if paCount < guCount:\n te = PA\n paCount += 1\n else:\n te = GU\n guCount += 1\n\n if te == GU and S[i] == PA:\n point -= 1\n elif te == PA and S[i] == GU:\n point += 1\n allTe += te\n dmp(allTe,'allTe')\n dmp(point)\n return point", "probC", "S = input()", "S", "input()", "input", "dmp(S)", "dmp", "S", "GU = 'g'", "GU", "'g'", "PA = 'p'", "PA", "'p'", "guCount = 0", "guCount", "0", "paCount = 0", "paCount", "0", "point = 0", "point", "0", "allTe = ''", "allTe", "''", "for i in range(len(S)):\n if paCount < guCount:\n te = PA\n paCount += 1\n else:\n te = GU\n guCount += 1\n\n if te == GU and S[i] == PA:\n point -= 1\n elif te == PA and S[i] == GU:\n point += 1\n allTe += te\n ", "i", "range(len(S))", "range", "len(S)", "len", "S", "if paCount < guCount:\n te = PA\n paCount += 1\n else:\n te = GU\n guCount += 1\n\n ", "paCount < guCount", "paCount", "guCount", "te = PA", "te", "PA", "paCount += 1", "paCount", "1", "te = GU", "te", "GU", "guCount += 1", "guCount", "1", "if te == GU and S[i] == PA:\n point -= 1\n elif te == PA and S[i] == GU:\n point += 1\n ", "te == GU and S[i] == PA", "te == GU", "te", "GU", "S[i] == PA", "S[i]", "S", "i", "PA", "point -= 1", "point", "1", "elif te == PA and S[i] == GU:\n point += 1\n ", "te == PA and S[i] == GU", "te == PA", "te", "PA", "S[i] == GU", "S[i]", "S", "i", "GU", "point += 1", "point", "1", "allTe += te", "allTe", "te", "dmp(allTe,'allTe')", "dmp", "allTe", "'allTe'", "dmp(point)", "dmp", "point", "return point", "point", "debug = False", "debug", "False", "ans = probC()", "ans", "probC()", "probC", "print(ans)", "print", "ans", "\"\"\"\n if S[i] == GU:\n if paCount < guCount:\n te = PA\n paCount += 1\n else:\n te = GU\n guCount += 1\n else:\n if paCount < guCount:\n te = PA\n paCount += 1\n else:\n te = GU\n guCount += 1\n\"\"\"", "ALPHABET = [chr(i+ord('a')) for i in range(26)]", "[chr(i+ord('a')) for i in range(26)]", "ALPHABET", "def getInt(): return int(input())", "def getInt(): return int(input())", "getInt", "def getIntLines(n): return [int(input()) for i in range(n)]", "def getIntLines(n): return [int(input()) for i in range(n)]", "getIntLines", "def probC():\n S = input()\n dmp(S)\n GU = 'g'\n PA = 'p'\n guCount = 0\n paCount = 0\n point = 0\n allTe = ''\n for i in range(len(S)):\n if paCount < guCount:\n te = PA\n paCount += 1\n else:\n te = GU\n guCount += 1\n\n if te == GU and S[i] == PA:\n point -= 1\n elif te == PA and S[i] == GU:\n point += 1\n allTe += te\n dmp(allTe,'allTe')\n dmp(point)\n return point", "def probC():\n S = input()\n dmp(S)\n GU = 'g'\n PA = 'p'\n guCount = 0\n paCount = 0\n point = 0\n allTe = ''\n for i in range(len(S)):\n if paCount < guCount:\n te = PA\n paCount += 1\n else:\n te = GU\n guCount += 1\n\n if te == GU and S[i] == PA:\n point -= 1\n elif te == PA and S[i] == GU:\n point += 1\n allTe += te\n dmp(allTe,'allTe')\n dmp(point)\n return point", "probC", "DIGIT = [chr(i+ord('0')) for i in range(10)]", "[chr(i+ord('0')) for i in range(10)]", "DIGIT", "def zeros2(n, m): return [zeros(m)]*n", "def zeros2(n, m): return [zeros(m)]*n", "zeros2", "def getIntList(): return [int(x) for x in input().split()]", "def getIntList(): return [int(x) for x in input().split()]", "getIntList", "ans = probC()", "probC()", "ans", "def zeros(n): return [0]*n", "def zeros(n): return [0]*n", "zeros", "def getIntMat(n):\n mat = []\n for i in range(n):\n mat.append(getIntList())\n return mat", "def getIntMat(n):\n mat = []\n for i in range(n):\n mat.append(getIntList())\n return mat", "getIntMat", "def dmp(x, cmt=''):\n global debug\n if debug:\n if cmt != '':\n print(cmt, ': ', end='')\n print(x)\n return x", "def dmp(x, cmt=''):\n global debug\n if debug:\n if cmt != '':\n print(cmt, ': ', end='')\n print(x)\n return x", "dmp", "debug = False", "False", "debug" ]
#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on 2019/2/ Solved on 2019/2/ @author: shinjisu """ # ARC 062 C AtCoDeer and Rock-Paper def getInt(): return int(input()) def getIntList(): return [int(x) for x in input().split()] def zeros(n): return [0]*n def getIntLines(n): return [int(input()) for i in range(n)] def getIntMat(n): mat = [] for i in range(n): mat.append(getIntList()) return mat def zeros2(n, m): return [zeros(m)]*n ALPHABET = [chr(i+ord('a')) for i in range(26)] DIGIT = [chr(i+ord('0')) for i in range(10)] def dmp(x, cmt=''): global debug if debug: if cmt != '': print(cmt, ': ', end='') print(x) return x def probC(): S = input() dmp(S) GU = 'g' PA = 'p' guCount = 0 paCount = 0 point = 0 allTe = '' for i in range(len(S)): if paCount < guCount: te = PA paCount += 1 else: te = GU guCount += 1 if te == GU and S[i] == PA: point -= 1 elif te == PA and S[i] == GU: point += 1 allTe += te dmp(allTe,'allTe') dmp(point) return point debug = False # True False ans = probC() print(ans) #for row in ans: # print(row) """ if S[i] == GU: if paCount < guCount: te = PA paCount += 1 else: te = GU guCount += 1 else: if paCount < guCount: te = PA paCount += 1 else: te = GU guCount += 1 """
[ 7, 0, 13, 4, 13, 4, 13, 2, 2, 4, 18, 13, 13, 17, 4, 18, 13, 13, 17, 17, 10, 4, 13 ]
[ [ 21, 2 ], [ 22, 11 ], [ 22, 16 ], [ 21, 22 ] ]
[ "s=input()\nprint((s.count(\"g\")-s.count(\"p\"))//2)", "s=input()", "s", "input()", "input", "print((s.count(\"g\")-s.count(\"p\"))//2)", "print", "(s.count(\"g\")-s.count(\"p\"))//2", "s.count(\"g\")-s.count(\"p\")", "s.count(\"g\")", "s.count", "s", "count", "\"g\"", "s.count(\"p\")", "s.count", "s", "count", "\"p\"", "2", "s=input()", "input()", "s" ]
s=input() print((s.count("g")-s.count("p"))//2)
[ 7, 15, 13, 0, 13, 18, 18, 13, 13, 13, 12, 13, 0, 13, 4, 18, 4, 13, 13, 0, 13, 2, 2, 4, 18, 13, 13, 17, 4, 18, 13, 13, 17, 17, 4, 13, 13, 14, 2, 13, 17, 4, 13, 10, 18, 13, 10, 12, 13 ]
[ [ 44, 4 ], [ 14, 13 ], [ 45, 17 ], [ 21, 20 ], [ 13, 25 ], [ 13, 30 ], [ 20, 36 ], [ 48, 42 ], [ 44, 45 ] ]
[ "import sys\n\ninput = sys.stdin.readline\n\n\ndef main():\n S = input().rstrip()\n\n ans = (S.count(\"g\") - S.count(\"p\")) // 2\n\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()", "import sys", "sys", "input = sys.stdin.readline", "input", "sys.stdin.readline", "sys.stdin", "sys", "stdin", "readline", "def main():\n S = input().rstrip()\n\n ans = (S.count(\"g\") - S.count(\"p\")) // 2\n\n print(ans)", "main", "S = input().rstrip()", "S", "input().rstrip()", "().rstrip", "()", "input", "rstrip", "ans = (S.count(\"g\") - S.count(\"p\")) // 2", "ans", "(S.count(\"g\") - S.count(\"p\")) // 2", "S.count(\"g\") - S.count(\"p\")", "S.count(\"g\")", "S.count", "S", "count", "\"g\"", "S.count(\"p\")", "S.count", "S", "count", "\"p\"", "2", "print(ans)", "print", "ans", "if __name__ == \"__main__\":\n main()", "__name__ == \"__main__\"", "__name__", "\"__main__\"", "main()", "main", "input = sys.stdin.readline", "sys.stdin.readline", "input", "def main():\n S = input().rstrip()\n\n ans = (S.count(\"g\") - S.count(\"p\")) // 2\n\n print(ans)", "def main():\n S = input().rstrip()\n\n ans = (S.count(\"g\") - S.count(\"p\")) // 2\n\n print(ans)", "main" ]
import sys input = sys.stdin.readline def main(): S = input().rstrip() ans = (S.count("g") - S.count("p")) // 2 print(ans) if __name__ == "__main__": main()
[ 7, 15, 13, 0, 13, 4, 13, 0, 13, 4, 18, 13, 13, 13, 0, 13, 18, 13, 17, 0, 13, 18, 13, 17, 0, 13, 2, 2, 4, 13, 13, 17, 13, 4, 13, 13, 10, 4, 13, 10, 2, 13, 10, 18, 13, 10, 4, 13, 10, 18, 13 ]
[ [ 37, 4 ], [ 46, 8 ], [ 38, 13 ], [ 43, 15 ], [ 47, 17 ], [ 49, 20 ], [ 47, 22 ], [ 40, 25 ], [ 38, 30 ], [ 50, 32 ], [ 41, 35 ], [ 37, 38 ], [ 40, 41 ], [ 43, 44 ], [ 46, 47 ], [ 49, 50 ] ]
[ "import collections\ns =input()\ns2=collections.Counter(s)\ngu = s2['g']\npa = s2['p']\npoint = len(s)//2-pa\nprint(point)", "import collections", "collections", "s =input()", "s", "input()", "input", "s2=collections.Counter(s)", "s2", "collections.Counter(s)", "collections.Counter", "collections", "Counter", "s", "gu = s2['g']", "gu", "s2['g']", "s2", "'g'", "pa = s2['p']", "pa", "s2['p']", "s2", "'p'", "point = len(s)//2-pa", "point", "len(s)//2-pa", "len(s)//2", "len(s)", "len", "s", "2", "pa", "print(point)", "print", "point", "s =input()", "input()", "s", "point = len(s)//2-pa", "len(s)//2-pa", "point", "gu = s2['g']", "s2['g']", "gu", "s2=collections.Counter(s)", "collections.Counter(s)", "s2", "pa = s2['p']", "s2['p']", "pa" ]
import collections s =input() s2=collections.Counter(s) gu = s2['g'] pa = s2['p'] point = len(s)//2-pa print(point)
[ 7, 0, 13, 4, 13, 4, 13, 0, 13, 17, 0, 13, 17, 28, 13, 4, 13, 4, 13, 13, 14, 2, 13, 17, 0, 13, 17, 14, 2, 18, 13, 13, 17, 0, 13, 17, 0, 13, 17, 14, 2, 18, 13, 13, 17, 0, 13, 17, 4, 13, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 4, 13 ]
[ [ 70, 2 ], [ 52, 8 ], [ 61, 11 ], [ 15, 14 ], [ 71, 19 ], [ 53, 22 ], [ 68, 22 ], [ 65, 22 ], [ 67, 25 ], [ 71, 30 ], [ 14, 31 ], [ 58, 34 ], [ 64, 37 ], [ 71, 42 ], [ 14, 43 ], [ 55, 46 ], [ 56, 50 ], [ 59, 50 ], [ 62, 50 ], [ 52, 53 ], [ 55, 56 ], [ 58, 59 ], [ 61, 62 ], [ 64, 65 ], [ 67, 68 ], [ 70, 71 ] ]
[ "s = list(input())\ng_minus_p = 0\nscore = 0\nfor i in range(len(s)):\n if g_minus_p > 0:\n g_minus_p -= 1\n if s[i] == \"g\":\n score += 1\n else:\n g_minus_p += 1\n if s[i] == \"p\":\n score -= 1\nprint(score)", "s = list(input())", "s", "list(input())", "list", "input()", "input", "g_minus_p = 0", "g_minus_p", "0", "score = 0", "score", "0", "for i in range(len(s)):\n if g_minus_p > 0:\n g_minus_p -= 1\n if s[i] == \"g\":\n score += 1\n else:\n g_minus_p += 1\n if s[i] == \"p\":\n score -= 1", "i", "range(len(s))", "range", "len(s)", "len", "s", "if g_minus_p > 0:\n g_minus_p -= 1\n if s[i] == \"g\":\n score += 1\n else:\n g_minus_p += 1\n if s[i] == \"p\":\n score -= 1", "g_minus_p > 0", "g_minus_p", "0", "g_minus_p -= 1", "g_minus_p", "1", "if s[i] == \"g\":\n score += 1\n ", "s[i] == \"g\"", "s[i]", "s", "i", "\"g\"", "score += 1", "score", "1", "g_minus_p += 1", "g_minus_p", "1", "if s[i] == \"p\":\n score -= 1", "s[i] == \"p\"", "s[i]", "s", "i", "\"p\"", "score -= 1", "score", "1", "print(score)", "print", "score", "g_minus_p = 0", "0", "g_minus_p", "score -= 1", "1", "score", "score += 1", "1", "score", "score = 0", "0", "score", "g_minus_p += 1", "1", "g_minus_p", "g_minus_p -= 1", "1", "g_minus_p", "s = list(input())", "list(input())", "s" ]
s = list(input()) g_minus_p = 0 score = 0 for i in range(len(s)): if g_minus_p > 0: g_minus_p -= 1 if s[i] == "g": score += 1 else: g_minus_p += 1 if s[i] == "p": score -= 1 print(score)
[ 7, 0, 13, 4, 13, 0, 13, 2, 2, 4, 13, 13, 17, 4, 18, 13, 13, 17, 4, 13, 13, 10, 2, 13, 10, 4, 13 ]
[ [ 25, 2 ], [ 22, 6 ], [ 26, 11 ], [ 26, 15 ], [ 23, 20 ], [ 22, 23 ], [ 25, 26 ] ]
[ "s=input()\nans=len(s)//2-s.count('p')\n\nprint(ans)", "s=input()", "s", "input()", "input", "ans=len(s)//2-s.count('p')", "ans", "len(s)//2-s.count('p')", "len(s)//2", "len(s)", "len", "s", "2", "s.count('p')", "s.count", "s", "count", "'p'", "print(ans)", "print", "ans", "ans=len(s)//2-s.count('p')", "len(s)//2-s.count('p')", "ans", "s=input()", "input()", "s" ]
s=input() ans=len(s)//2-s.count('p') print(ans)
[ 7, 0, 13, 4, 13, 0, 13, 4, 18, 13, 13, 17, 0, 13, 2, 4, 13, 13, 17, 4, 13, 2, 13, 13, 10, 4, 13, 10, 4, 13, 10, 2, 13 ]
[ [ 28, 2 ], [ 25, 6 ], [ 29, 9 ], [ 31, 13 ], [ 29, 17 ], [ 32, 22 ], [ 26, 23 ], [ 25, 26 ], [ 28, 29 ], [ 31, 32 ] ]
[ "s = input()\nt_s = s.count(\"p\")\na_s = len(s) // 2\nprint(a_s-t_s)", "s = input()", "s", "input()", "input", "t_s = s.count(\"p\")", "t_s", "s.count(\"p\")", "s.count", "s", "count", "\"p\"", "a_s = len(s) // 2", "a_s", "len(s) // 2", "len(s)", "len", "s", "2", "print(a_s-t_s)", "print", "a_s-t_s", "a_s", "t_s", "t_s = s.count(\"p\")", "s.count(\"p\")", "t_s", "s = input()", "input()", "s", "a_s = len(s) // 2", "len(s) // 2", "a_s" ]
s = input() t_s = s.count("p") a_s = len(s) // 2 print(a_s-t_s)
[ 7, 0, 13, 4, 13, 0, 13, 2, 4, 13, 13, 17, 0, 13, 4, 18, 13, 13, 17, 4, 13, 2, 13, 13, 10, 4, 13, 10, 4, 13, 10, 2, 13 ]
[ [ 25, 2 ], [ 31, 6 ], [ 26, 10 ], [ 28, 13 ], [ 26, 16 ], [ 32, 22 ], [ 29, 23 ], [ 25, 26 ], [ 28, 29 ], [ 31, 32 ] ]
[ "S = input()\npd = len(S) // 2\npt = S.count(\"p\")\n\nprint(pd- pt)", "S = input()", "S", "input()", "input", "pd = len(S) // 2", "pd", "len(S) // 2", "len(S)", "len", "S", "2", "pt = S.count(\"p\")", "pt", "S.count(\"p\")", "S.count", "S", "count", "\"p\"", "print(pd- pt)", "print", "pd- pt", "pd", "pt", "S = input()", "input()", "S", "pt = S.count(\"p\")", "S.count(\"p\")", "pt", "pd = len(S) // 2", "len(S) // 2", "pd" ]
S = input() pd = len(S) // 2 pt = S.count("p") print(pd- pt)
[ 7, 12, 13, 0, 13, 4, 13, 4, 13, 0, 13, 4, 13, 13, 0, 13, 17, 0, 13, 17, 0, 13, 17, 0, 13, 17, 28, 13, 4, 13, 4, 13, 13, 14, 40, 2, 13, 13, 17, 0, 13, 17, 14, 2, 18, 13, 13, 17, 0, 13, 17, 14, 2, 18, 13, 13, 17, 0, 13, 17, 0, 13, 17, 0, 13, 17, 4, 13, 2, 13, 13, 4, 13, 10, 12, 13 ]
[ [ 5, 4 ], [ 11, 10 ], [ 4, 13 ], [ 16, 15 ], [ 19, 18 ], [ 22, 21 ], [ 25, 24 ], [ 28, 27 ], [ 4, 32 ], [ 15, 36 ], [ 40, 36 ], [ 18, 37 ], [ 64, 37 ], [ 58, 37 ], [ 41, 40 ], [ 4, 45 ], [ 27, 46 ], [ 50, 49 ], [ 4, 54 ], [ 27, 55 ], [ 59, 58 ], [ 62, 61 ], [ 65, 64 ], [ 61, 69 ], [ 21, 69 ], [ 49, 70 ], [ 24, 70 ], [ 75, 72 ] ]
[ "def resolve():\n s=str(input())\n val=len(s)\n cntg=0\n cntp=0\n w=0\n l=0\n for i in range(len(s)):\n if cntg-cntp<=0:\n cntg+=1\n if s[i]=='p':\n l+=1\n else:\n if s[i]=='g':\n cntp+=1\n w+=1\n else:\n cntp+=1\n print(w-l)\n\n\n\nresolve()", "def resolve():\n s=str(input())\n val=len(s)\n cntg=0\n cntp=0\n w=0\n l=0\n for i in range(len(s)):\n if cntg-cntp<=0:\n cntg+=1\n if s[i]=='p':\n l+=1\n else:\n if s[i]=='g':\n cntp+=1\n w+=1\n else:\n cntp+=1\n print(w-l)", "resolve", "s=str(input())", "s", "str(input())", "str", "input()", "input", "val=len(s)", "val", "len(s)", "len", "s", "cntg=0", "cntg", "0", "cntp=0", "cntp", "0", "w=0", "w", "0", "l=0", "l", "0", "for i in range(len(s)):\n if cntg-cntp<=0:\n cntg+=1\n if s[i]=='p':\n l+=1\n else:\n if s[i]=='g':\n cntp+=1\n w+=1\n else:\n cntp+=1\n ", "i", "range(len(s))", "range", "len(s)", "len", "s", "if cntg-cntp<=0:\n cntg+=1\n if s[i]=='p':\n l+=1\n else:\n if s[i]=='g':\n cntp+=1\n w+=1\n else:\n cntp+=1\n ", "cntg-cntp<=0", "cntg-cntp", "cntg", "cntp", "0", "cntg+=1", "cntg", "1", "if s[i]=='p':\n l+=1\n ", "s[i]=='p'", "s[i]", "s", "i", "'p'", "l+=1", "l", "1", "if s[i]=='g':\n cntp+=1\n w+=1\n else:\n cntp+=1\n ", "s[i]=='g'", "s[i]", "s", "i", "'g'", "cntp+=1", "cntp", "1", "w+=1", "w", "1", "cntp+=1", "cntp", "1", "print(w-l)", "print", "w-l", "w", "l", "resolve()", "resolve", "def resolve():\n s=str(input())\n val=len(s)\n cntg=0\n cntp=0\n w=0\n l=0\n for i in range(len(s)):\n if cntg-cntp<=0:\n cntg+=1\n if s[i]=='p':\n l+=1\n else:\n if s[i]=='g':\n cntp+=1\n w+=1\n else:\n cntp+=1\n print(w-l)", "def resolve():\n s=str(input())\n val=len(s)\n cntg=0\n cntp=0\n w=0\n l=0\n for i in range(len(s)):\n if cntg-cntp<=0:\n cntg+=1\n if s[i]=='p':\n l+=1\n else:\n if s[i]=='g':\n cntp+=1\n w+=1\n else:\n cntp+=1\n print(w-l)", "resolve" ]
def resolve(): s=str(input()) val=len(s) cntg=0 cntp=0 w=0 l=0 for i in range(len(s)): if cntg-cntp<=0: cntg+=1 if s[i]=='p': l+=1 else: if s[i]=='g': cntp+=1 w+=1 else: cntp+=1 print(w-l) resolve()
[ 7, 15, 0, 13, 4, 13, 4, 13, 0, 13, 4, 13, 13, 0, 13, 4, 13, 13, 0, 13, 2, 18, 13, 17, 18, 13, 17, 4, 13, 2, 13, 17, 10, 4, 13, 10, 4, 13, 10, 2, 13, 10, 4, 13 ]
[ [ 42, 3 ], [ 36, 9 ], [ 43, 12 ], [ 33, 14 ], [ 43, 17 ], [ 39, 19 ], [ 34, 22 ], [ 34, 25 ], [ 40, 30 ], [ 33, 34 ], [ 36, 37 ], [ 39, 40 ], [ 42, 43 ] ]
[ "from collections import Counter\ns = list(input())\nlens = len(s)\ncs = Counter(s)\n\ngp = cs[\"g\"] - cs[\"p\"]\n\nprint(gp // 2)", "from collections import Counter", "s = list(input())", "s", "list(input())", "list", "input()", "input", "lens = len(s)", "lens", "len(s)", "len", "s", "cs = Counter(s)", "cs", "Counter(s)", "Counter", "s", "gp = cs[\"g\"] - cs[\"p\"]", "gp", "cs[\"g\"] - cs[\"p\"]", "cs[\"g\"]", "cs", "\"g\"", "cs[\"p\"]", "cs", "\"p\"", "print(gp // 2)", "print", "gp // 2", "gp", "2", "cs = Counter(s)", "Counter(s)", "cs", "lens = len(s)", "len(s)", "lens", "gp = cs[\"g\"] - cs[\"p\"]", "cs[\"g\"] - cs[\"p\"]", "gp", "s = list(input())", "list(input())", "s" ]
from collections import Counter s = list(input()) lens = len(s) cs = Counter(s) gp = cs["g"] - cs["p"] print(gp // 2)
[ 7, 0, 13, 4, 18, 4, 13, 13, 0, 13, 17, 13, 17, 14, 2, 18, 13, 17, 17, 0, 13, 17, 0, 13, 17, 13, 17, 28, 13, 4, 13, 17, 4, 13, 13, 14, 2, 2, 18, 13, 13, 17, 40, 2, 13, 17, 13, 0, 13, 17, 0, 13, 17, 14, 2, 18, 13, 13, 17, 0, 13, 17, 14, 2, 2, 18, 13, 13, 17, 40, 2, 13, 17, 13, 0, 13, 17, 0, 13, 17, 0, 13, 17, 4, 13, 2, 13, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13 ]
[ [ 101, 2 ], [ 104, 9 ], [ 89, 11 ], [ 102, 16 ], [ 113, 20 ], [ 122, 23 ], [ 110, 25 ], [ 29, 28 ], [ 102, 34 ], [ 102, 39 ], [ 28, 40 ], [ 111, 44 ], [ 120, 44 ], [ 117, 44 ], [ 123, 46 ], [ 93, 46 ], [ 99, 46 ], [ 95, 48 ], [ 116, 51 ], [ 102, 56 ], [ 28, 57 ], [ 98, 60 ], [ 102, 66 ], [ 28, 67 ], [ 111, 71 ], [ 120, 71 ], [ 117, 71 ], [ 123, 73 ], [ 93, 73 ], [ 99, 73 ], [ 119, 75 ], [ 92, 78 ], [ 107, 81 ], [ 96, 86 ], [ 105, 86 ], [ 108, 87 ], [ 114, 87 ], [ 90, 87 ], [ 89, 90 ], [ 92, 93 ], [ 95, 96 ], [ 98, 99 ], [ 101, 102 ], [ 104, 105 ], [ 107, 108 ], [ 110, 111 ], [ 113, 114 ], [ 116, 117 ], [ 119, 120 ], [ 122, 123 ] ]
[ "s=input().rstrip()\nwin,lose=0,0\nif s[0] == 'p':\n lose += 1\ncountg,countp=1,0\nfor i in range(1,len(s)):\n if s[i] =='g' and (countp +1 <= countg):\n win += 1\n countp += 1\n elif s[i] =='g':\n countg += 1\n elif s[i] =='p' and (countp +1 <= countg):\n countp += 1\n else:\n countg += 1\n lose += 1\nprint(win-lose)", "s=input().rstrip()", "s", "input().rstrip()", "().rstrip", "()", "input", "rstrip", "win,lose=0,0", "win", "0", "lose", "0", "if s[0] == 'p':\n lose += 1", "s[0] == 'p'", "s[0]", "s", "0", "'p'", "lose += 1", "lose", "1", "countg,countp=1,0", "countg", "1", "countp", "0", "for i in range(1,len(s)):\n if s[i] =='g' and (countp +1 <= countg):\n win += 1\n countp += 1\n elif s[i] =='g':\n countg += 1\n elif s[i] =='p' and (countp +1 <= countg):\n countp += 1\n else:\n countg += 1\n lose += 1", "i", "range(1,len(s))", "range", "1", "len(s)", "len", "s", "if s[i] =='g' and (countp +1 <= countg):\n win += 1\n countp += 1\n elif s[i] =='g':\n countg += 1\n elif s[i] =='p' and (countp +1 <= countg):\n countp += 1\n else:\n countg += 1\n lose += 1", "s[i] =='g' and (countp +1 <= countg)", "s[i] =='g'", "s[i]", "s", "i", "'g'", "countp +1 <= countg", "countp +1", "countp", "1", "countg", "win += 1", "win", "1", "countp += 1", "countp", "1", "elif s[i] =='g':\n countg += 1\n ", "s[i] =='g'", "s[i]", "s", "i", "'g'", "countg += 1", "countg", "1", "elif s[i] =='p' and (countp +1 <= countg):\n countp += 1\n ", "s[i] =='p' and (countp +1 <= countg)", "s[i] =='p'", "s[i]", "s", "i", "'p'", "countp +1 <= countg", "countp +1", "countp", "1", "countg", "countp += 1", "countp", "1", "countg += 1", "countg", "1", "lose += 1", "lose", "1", "print(win-lose)", "print", "win-lose", "win", "lose", "lose=0,0", "0", "lose", "countg += 1", "1", "countg", "win += 1", "1", "win", "countg += 1", "1", "countg", "s=input().rstrip()", "input().rstrip()", "s", "win,lose=0,0", "0", "win", "lose += 1", "1", "lose", "countp=1,0", "0", "countp", "lose += 1", "1", "lose", "countp += 1", "1", "countp", "countp += 1", "1", "countp", "countg,countp=1,0", "1", "countg" ]
s=input().rstrip() win,lose=0,0 if s[0] == 'p': lose += 1 countg,countp=1,0 for i in range(1,len(s)): if s[i] =='g' and (countp +1 <= countg): win += 1 countp += 1 elif s[i] =='g': countg += 1 elif s[i] =='p' and (countp +1 <= countg): countp += 1 else: countg += 1 lose += 1 print(win-lose)
[ 7, 15, 13, 0, 13, 18, 18, 13, 13, 13, 0, 13, 18, 18, 13, 13, 13, 0, 13, 4, 13, 0, 13, 4, 13, 13, 0, 13, 2, 17, 2, 2, 13, 17, 17, 0, 13, 17, 28, 13, 13, 4, 13, 13, 13, 14, 40, 13, 13, 14, 2, 13, 17, 4, 13, 13, 10, 18, 13, 10, 2, 13, 10, 18, 13, 10, 4, 13, 10, 4, 13, 10, 17, 13 ]
[ [ 57, 4 ], [ 63, 11 ], [ 69, 18 ], [ 66, 22 ], [ 70, 25 ], [ 60, 27 ], [ 67, 32 ], [ 72, 36 ], [ 70, 43 ], [ 61, 44 ], [ 73, 55 ], [ 57, 58 ], [ 60, 61 ], [ 63, 64 ], [ 66, 67 ], [ 69, 70 ], [ 72, 73 ] ]
[ "# coding: utf-8\n# Your code here!\nimport sys\nreadline = sys.stdin.readline\nread = sys.stdin.read\n\n#n,*ta = map(int, read().split())\ns = input()\nn = len(s)\nt = \"gp\"*((n+2)//2)\n\nans = 0\nfor i,j in zip(s,t):\n if i != j:\n if i==\"g\": ans += 1\n else: ans -= 1\n\nprint(ans)", "import sys", "sys", "readline = sys.stdin.readline", "readline", "sys.stdin.readline", "sys.stdin", "sys", "stdin", "readline", "read = sys.stdin.read", "read", "sys.stdin.read", "sys.stdin", "sys", "stdin", "read", "s = input()", "s", "input()", "input", "n = len(s)", "n", "len(s)", "len", "s", "t = \"gp\"*((n+2)//2)", "t", "\"gp\"*((n+2)//2)", "\"gp\"", "(n+2)//2", "n+2", "n", "2", "2", "ans = 0", "ans", "0", "for i,j in zip(s,t):\n if i != j:\n if i==\"g\": ans += 1\n else: ans -= 1", "i", "j", "zip(s,t)", "zip", "s", "t", "if i != j:\n if i==\"g\": ans += 1\n else: ans -= 1", "i != j", "i", "j", "if i==\"g\": ans += 1\n else: ans -= 1", "i==\"g\"", "i", "\"g\"", "print(ans)", "print", "ans", "readline = sys.stdin.readline", "sys.stdin.readline", "readline", "t = \"gp\"*((n+2)//2)", "\"gp\"*((n+2)//2)", "t", "read = sys.stdin.read", "sys.stdin.read", "read", "n = len(s)", "len(s)", "n", "s = input()", "input()", "s", "ans = 0", "0", "ans" ]
# coding: utf-8 # Your code here! import sys readline = sys.stdin.readline read = sys.stdin.read #n,*ta = map(int, read().split()) s = input() n = len(s) t = "gp"*((n+2)//2) ans = 0 for i,j in zip(s,t): if i != j: if i=="g": ans += 1 else: ans -= 1 print(ans)
[ 7, 15, 13, 15, 13, 15, 13, 15, 13, 15, 13, 15, 13, 15, 13, 15, 0, 13, 18, 18, 13, 13, 13, 4, 18, 13, 13, 17, 0, 13, 2, 2, 17, 17, 17, 12, 13, 12, 13, 12, 13, 41, 28, 13, 4, 13, 13, 4, 4, 13, 12, 13, 23, 13, 12, 13, 0, 13, 4, 18, 4, 13, 13, 0, 13, 17, 28, 13, 13, 4, 13, 13, 14, 2, 13, 17, 0, 13, 2, 13, 17, 14, 2, 13, 17, 0, 13, 2, 2, 13, 17, 17, 4, 13, 13, 14, 2, 13, 17, 4, 13, 10, 12, 13, 10, 2, 13, 10, 12, 13, 10, 12, 13, 10, 12, 13, 10, 12, 13, 10, 18, 13 ]
[ [ 120, 17 ], [ 105, 29 ], [ 44, 43 ], [ 109, 49 ], [ 53, 53 ], [ 58, 57 ], [ 121, 61 ], [ 65, 64 ], [ 57, 71 ], [ 78, 77 ], [ 87, 86 ], [ 86, 94 ], [ 77, 94 ], [ 64, 94 ], [ 112, 100 ], [ 105, 106 ], [ 120, 121 ] ]
[ "import bisect\nimport copy\nimport heapq\nimport sys\nimport itertools\nimport math\nimport queue\nfrom functools import lru_cache\ninput = sys.stdin.readline\nsys.setrecursionlimit(1000000)\nmod = 10 ** 9 + 7 \n\ndef read_values(): return map(int, input().split())\ndef read_index(): return map(lambda x: int(x) - 1, input().split())\ndef read_list(): return list(read_values())\ndef read_lists(N): return [read_list() for n in range(N)]\n\n\ndef main():\n S = input().strip()\n\n res = 0\n for i, s in enumerate(S):\n if s == \"g\":\n res += i % 2\n elif s == \"p\":\n res -= (i + 1) % 2\n print(res)\n\n\n\nif __name__ == \"__main__\":\n main()", "import bisect", "bisect", "import copy", "copy", "import heapq", "heapq", "import sys", "sys", "import itertools", "itertools", "import math", "math", "import queue", "queue", "from functools import lru_cache", "input = sys.stdin.readline", "input", "sys.stdin.readline", "sys.stdin", "sys", "stdin", "readline", "sys.setrecursionlimit(1000000)", "sys.setrecursionlimit", "sys", "setrecursionlimit", "1000000", "mod = 10 ** 9 + 7", "mod", "10 ** 9 + 7", "10 ** 9", "10", "9", "7", "def read_values(): return map(int, input().split())", "read_values", "def read_index(): return map(lambda x: int(x) - 1, input().split())", "read_index", "def read_list(): return list(read_values())", "read_list", "read_list() for n in range(N)", "for n in range(N)", "n", "range(N)", "range", "N", "for n in range(N)", "read_list()", "read_list", "def read_lists(N): return [read_list() for n in range(N)]", "read_lists", "N", "N", "def main():\n S = input().strip()\n\n res = 0\n for i, s in enumerate(S):\n if s == \"g\":\n res += i % 2\n elif s == \"p\":\n res -= (i + 1) % 2\n print(res)", "main", "S = input().strip()", "S", "input().strip()", "().strip", "()", "input", "strip", "res = 0", "res", "0", "for i, s in enumerate(S):\n if s == \"g\":\n res += i % 2\n elif s == \"p\":\n res -= (i + 1) % 2\n ", "i", "s", "enumerate(S)", "enumerate", "S", "if s == \"g\":\n res += i % 2\n elif s == \"p\":\n res -= (i + 1) % 2\n ", "s == \"g\"", "s", "\"g\"", "res += i % 2", "res", "i % 2", "i", "2", "elif s == \"p\":\n res -= (i + 1) % 2\n ", "s == \"p\"", "s", "\"p\"", "res -= (i + 1) % 2", "res", "(i + 1) % 2", "i + 1", "i", "1", "2", "print(res)", "print", "res", "if __name__ == \"__main__\":\n main()", "__name__ == \"__main__\"", "__name__", "\"__main__\"", "main()", "main", "def read_index(): return map(lambda x: int(x) - 1, input().split())", "def read_index(): return map(lambda x: int(x) - 1, input().split())", "read_index", "mod = 10 ** 9 + 7", "10 ** 9 + 7", "mod", "def read_list(): return list(read_values())", "def read_list(): return list(read_values())", "read_list", "def main():\n S = input().strip()\n\n res = 0\n for i, s in enumerate(S):\n if s == \"g\":\n res += i % 2\n elif s == \"p\":\n res -= (i + 1) % 2\n print(res)", "def main():\n S = input().strip()\n\n res = 0\n for i, s in enumerate(S):\n if s == \"g\":\n res += i % 2\n elif s == \"p\":\n res -= (i + 1) % 2\n print(res)", "main", "def read_lists(N): return [read_list() for n in range(N)]", "def read_lists(N): return [read_list() for n in range(N)]", "read_lists", "def read_values(): return map(int, input().split())", "def read_values(): return map(int, input().split())", "read_values", "input = sys.stdin.readline", "sys.stdin.readline", "input" ]
import bisect import copy import heapq import sys import itertools import math import queue from functools import lru_cache input = sys.stdin.readline sys.setrecursionlimit(1000000) mod = 10 ** 9 + 7 def read_values(): return map(int, input().split()) def read_index(): return map(lambda x: int(x) - 1, input().split()) def read_list(): return list(read_values()) def read_lists(N): return [read_list() for n in range(N)] def main(): S = input().strip() res = 0 for i, s in enumerate(S): if s == "g": res += i % 2 elif s == "p": res -= (i + 1) % 2 print(res) if __name__ == "__main__": main()
[ 7, 15, 13, 13, 13, 13, 13, 13, 13, 12, 13, 0, 13, 17, 0, 13, 17, 0, 13, 17, 28, 13, 13, 4, 13, 13, 14, 2, 13, 17, 14, 2, 13, 13, 0, 13, 17, 0, 13, 17, 0, 13, 17, 14, 2, 13, 13, 0, 13, 17, 0, 13, 17, 0, 13, 17, 4, 13, 13, 29, 23, 13, 12, 13, 12, 13, 28, 13, 18, 13, 13, 28, 13, 4, 18, 13, 13, 27, 13, 0, 13, 4, 13, 0, 13, 4, 13, 13, 4, 13, 13, 14, 2, 13, 17, 4, 13, 10, 12, 13, 10, 12, 13 ]
[ [ 13, 12 ], [ 16, 15 ], [ 19, 18 ], [ 61, 25 ], [ 15, 32 ], [ 51, 32 ], [ 35, 32 ], [ 12, 33 ], [ 54, 33 ], [ 41, 33 ], [ 36, 35 ], [ 39, 38 ], [ 42, 41 ], [ 15, 45 ], [ 51, 45 ], [ 35, 45 ], [ 12, 46 ], [ 54, 46 ], [ 41, 46 ], [ 49, 48 ], [ 52, 51 ], [ 55, 54 ], [ 48, 58 ], [ 38, 58 ], [ 18, 58 ], [ 61, 61 ], [ 68, 67 ], [ 73, 72 ], [ 67, 75 ], [ 72, 78 ], [ 81, 80 ], [ 65, 82 ], [ 85, 84 ], [ 80, 87 ], [ 99, 89 ], [ 84, 90 ], [ 102, 96 ] ]
[ "#!/usr/bin/env python3\nimport sys, math, fractions, itertools, collections, copy, heapq\n\n\ndef solve(s: str):\n G = 0\n P = 0\n res = 0\n for i, ss in enumerate(s):\n if ss == 'p':\n if P < G:\n P += 1\n else:\n res -= 1\n G += 1\n else:\n if P < G:\n res += 1\n P += 1\n else:\n G += 1\n print(res)\n return\n\n\n# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools (tips: You use the default template now. You can remove this line by using your custom template)\ndef main():\n def iterate_tokens():\n for line in sys.stdin:\n for word in line.split():\n yield word\n tokens = iterate_tokens()\n s = next(tokens) # type: str\n solve(s)\n\nif __name__ == '__main__':\n main()", "import sys, math, fractions, itertools, collections, copy, heapq", "sys", "math", "fractions", "itertools", "collections", "copy", "heapq", "def solve(s: str):\n G = 0\n P = 0\n res = 0\n for i, ss in enumerate(s):\n if ss == 'p':\n if P < G:\n P += 1\n else:\n res -= 1\n G += 1\n else:\n if P < G:\n res += 1\n P += 1\n else:\n G += 1\n print(res)\n return\n\n\n# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools (tips: You use the default template now. You can remove this line by using your custom template)", "solve", "G = 0", "G", "0", "P = 0", "P", "0", "res = 0", "res", "0", "for i, ss in enumerate(s):\n if ss == 'p':\n if P < G:\n P += 1\n else:\n res -= 1\n G += 1\n else:\n if P < G:\n res += 1\n P += 1\n else:\n G += 1\n ", "i", "ss", "enumerate(s)", "enumerate", "s", "if ss == 'p':\n if P < G:\n P += 1\n else:\n res -= 1\n G += 1\n else:\n if P < G:\n res += 1\n P += 1\n else:\n G += 1\n ", "ss == 'p'", "ss", "'p'", "if P < G:\n P += 1\n else:\n res -= 1\n G += 1\n ", "P < G", "P", "G", "P += 1", "P", "1", "res -= 1", "res", "1", "G += 1", "G", "1", "if P < G:\n res += 1\n P += 1\n else:\n G += 1\n ", "P < G", "P", "G", "res += 1", "res", "1", "P += 1", "P", "1", "G += 1", "G", "1", "print(res)", "print", "res", "return", "s: str", "s", "def main():\n def iterate_tokens():\n for line in sys.stdin:\n for word in line.split():\n yield word\n tokens = iterate_tokens()\n s = next(tokens) # type: str\n solve(s)", "main", "def iterate_tokens():\n for line in sys.stdin:\n for word in line.split():\n yield word\n ", "iterate_tokens", "for line in sys.stdin:\n for word in line.split():\n yield word\n ", "line", "sys.stdin", "sys", "stdin", "for word in line.split():\n yield word\n ", "word", "line.split()", "line.split", "line", "split", "yield word", "word", "tokens = iterate_tokens()", "tokens", "iterate_tokens()", "iterate_tokens", "s = next(tokens)", "s", "next(tokens)", "next", "tokens", "solve(s)", "solve", "s", "if __name__ == '__main__':\n main()", "__name__ == '__main__'", "__name__", "'__main__'", "main()", "main", "def solve(s: str):\n G = 0\n P = 0\n res = 0\n for i, ss in enumerate(s):\n if ss == 'p':\n if P < G:\n P += 1\n else:\n res -= 1\n G += 1\n else:\n if P < G:\n res += 1\n P += 1\n else:\n G += 1\n print(res)\n return\n\n\n# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools (tips: You use the default template now. You can remove this line by using your custom template)", "def solve(s: str):\n G = 0\n P = 0\n res = 0\n for i, ss in enumerate(s):\n if ss == 'p':\n if P < G:\n P += 1\n else:\n res -= 1\n G += 1\n else:\n if P < G:\n res += 1\n P += 1\n else:\n G += 1\n print(res)\n return\n\n\n# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools (tips: You use the default template now. You can remove this line by using your custom template)", "solve", "def main():\n def iterate_tokens():\n for line in sys.stdin:\n for word in line.split():\n yield word\n tokens = iterate_tokens()\n s = next(tokens) # type: str\n solve(s)", "def main():\n def iterate_tokens():\n for line in sys.stdin:\n for word in line.split():\n yield word\n tokens = iterate_tokens()\n s = next(tokens) # type: str\n solve(s)", "main" ]
#!/usr/bin/env python3 import sys, math, fractions, itertools, collections, copy, heapq def solve(s: str): G = 0 P = 0 res = 0 for i, ss in enumerate(s): if ss == 'p': if P < G: P += 1 else: res -= 1 G += 1 else: if P < G: res += 1 P += 1 else: G += 1 print(res) return # Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools (tips: You use the default template now. You can remove this line by using your custom template) def main(): def iterate_tokens(): for line in sys.stdin: for word in line.split(): yield word tokens = iterate_tokens() s = next(tokens) # type: str solve(s) if __name__ == '__main__': main()
[ 7, 0, 13, 4, 13, 0, 13, 4, 13, 13, 0, 13, 4, 18, 13, 13, 17, 4, 13, 2, 2, 13, 17, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13 ]
[ [ 31, 2 ], [ 28, 6 ], [ 32, 9 ], [ 25, 11 ], [ 32, 14 ], [ 29, 21 ], [ 26, 23 ], [ 25, 26 ], [ 28, 29 ], [ 31, 32 ] ]
[ "s=input()\nn=len(s)\np=s.count('p')\nprint(n//2-p)", "s=input()", "s", "input()", "input", "n=len(s)", "n", "len(s)", "len", "s", "p=s.count('p')", "p", "s.count('p')", "s.count", "s", "count", "'p'", "print(n//2-p)", "print", "n//2-p", "n//2", "n", "2", "p", "p=s.count('p')", "s.count('p')", "p", "n=len(s)", "len(s)", "n", "s=input()", "input()", "s" ]
s=input() n=len(s) p=s.count('p') print(n//2-p)
[ 7, 0, 13, 4, 13, 0, 13, 17, 0, 13, 17, 28, 13, 4, 13, 13, 14, 2, 13, 17, 0, 13, 17, 0, 13, 17, 14, 2, 13, 13, 4, 13, 17, 4, 13, 2, 2, 2, 13, 13, 17, 13, 10, 4, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13 ]
[ [ 43, 2 ], [ 55, 6 ], [ 46, 9 ], [ 13, 12 ], [ 44, 15 ], [ 12, 18 ], [ 49, 21 ], [ 52, 24 ], [ 53, 28 ], [ 47, 28 ], [ 50, 29 ], [ 56, 29 ], [ 53, 38 ], [ 47, 38 ], [ 50, 39 ], [ 56, 39 ], [ 50, 41 ], [ 56, 41 ], [ 43, 44 ], [ 46, 47 ], [ 49, 50 ], [ 52, 53 ], [ 55, 56 ] ]
[ "# -*- coding: utf-8 -*-\ns = input()\n\ncp = 0\ncg = 0\n\nfor ss in list(s):\n if ss == \"p\":\n cp += 1\n else:\n cg += 1\n\nif cg==cp:\n print(0)\nelse:\n print((cg+cp)//2 - cp)", "s = input()", "s", "input()", "input", "cp = 0", "cp", "0", "cg = 0", "cg", "0", "for ss in list(s):\n if ss == \"p\":\n cp += 1\n else:\n cg += 1", "ss", "list(s)", "list", "s", "if ss == \"p\":\n cp += 1\n else:\n cg += 1", "ss == \"p\"", "ss", "\"p\"", "cp += 1", "cp", "1", "cg += 1", "cg", "1", "if cg==cp:\n print(0)\nelse:\n print((cg+cp)//2 - cp)", "cg==cp", "cg", "cp", "print(0)", "print", "0", "print((cg+cp)//2 - cp)", "print", "(cg+cp)//2 - cp", "(cg+cp)//2", "cg+cp", "cg", "cp", "2", "cp", "s = input()", "input()", "s", "cg = 0", "0", "cg", "cp += 1", "1", "cp", "cg += 1", "1", "cg", "cp = 0", "0", "cp" ]
# -*- coding: utf-8 -*- s = input() cp = 0 cg = 0 for ss in list(s): if ss == "p": cp += 1 else: cg += 1 if cg==cp: print(0) else: print((cg+cp)//2 - cp)
[ 7, 0, 13, 4, 13, 0, 13, 17, 28, 13, 4, 13, 4, 13, 13, 14, 2, 2, 2, 13, 17, 17, 2, 18, 13, 13, 17, 0, 13, 17, 14, 2, 2, 2, 13, 17, 17, 2, 18, 13, 13, 17, 0, 13, 17, 4, 13, 13, 10, 17, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13 ]
[ [ 55, 2 ], [ 58, 6 ], [ 10, 9 ], [ 56, 14 ], [ 9, 19 ], [ 56, 24 ], [ 9, 25 ], [ 49, 28 ], [ 9, 34 ], [ 56, 39 ], [ 9, 40 ], [ 52, 43 ], [ 53, 47 ], [ 50, 47 ], [ 59, 47 ], [ 49, 50 ], [ 52, 53 ], [ 55, 56 ], [ 58, 59 ] ]
[ "s = input()\nans = 0\nfor i in range(len(s)):\n if i % 2 == 0 and s[i] == \"p\":\n ans -= 1\n elif i % 2 == 1 and s[i] == \"g\":\n ans += 1\nprint(ans)", "s = input()", "s", "input()", "input", "ans = 0", "ans", "0", "for i in range(len(s)):\n if i % 2 == 0 and s[i] == \"p\":\n ans -= 1\n elif i % 2 == 1 and s[i] == \"g\":\n ans += 1", "i", "range(len(s))", "range", "len(s)", "len", "s", "if i % 2 == 0 and s[i] == \"p\":\n ans -= 1\n elif i % 2 == 1 and s[i] == \"g\":\n ans += 1", "i % 2 == 0 and s[i] == \"p\"", "i % 2 == 0", "i % 2", "i", "2", "0", "s[i] == \"p\"", "s[i]", "s", "i", "\"p\"", "ans -= 1", "ans", "1", "elif i % 2 == 1 and s[i] == \"g\":\n ans += 1", "i % 2 == 1 and s[i] == \"g\"", "i % 2 == 1", "i % 2", "i", "2", "1", "s[i] == \"g\"", "s[i]", "s", "i", "\"g\"", "ans += 1", "ans", "1", "print(ans)", "print", "ans", "ans -= 1", "1", "ans", "ans += 1", "1", "ans", "s = input()", "input()", "s", "ans = 0", "0", "ans" ]
s = input() ans = 0 for i in range(len(s)): if i % 2 == 0 and s[i] == "p": ans -= 1 elif i % 2 == 1 and s[i] == "g": ans += 1 print(ans)
[ 7, 12, 13, 0, 13, 4, 13, 0, 13, 18, 13, 39, 17, 17, 0, 13, 18, 13, 39, 17, 17, 0, 13, 2, 4, 18, 13, 13, 17, 4, 18, 13, 13, 17, 29, 13, 4, 13, 4, 13, 10, 12, 13 ]
[ [ 5, 4 ], [ 9, 8 ], [ 4, 10 ], [ 16, 15 ], [ 4, 17 ], [ 23, 22 ], [ 15, 26 ], [ 8, 31 ], [ 22, 35 ], [ 42, 39 ] ]
[ "def solve():\n S = input()\n even = S[0::2]\n odd = S[1::2]\n ans = odd.count('g')-even.count('p')\n return ans\nprint(solve())", "def solve():\n S = input()\n even = S[0::2]\n odd = S[1::2]\n ans = odd.count('g')-even.count('p')\n return ans", "solve", "S = input()", "S", "input()", "input", "even = S[0::2]", "even", "S[0::2]", "S", "0::2", "0", "2", "odd = S[1::2]", "odd", "S[1::2]", "S", "1::2", "1", "2", "ans = odd.count('g')-even.count('p')", "ans", "odd.count('g')-even.count('p')", "odd.count('g')", "odd.count", "odd", "count", "'g'", "even.count('p')", "even.count", "even", "count", "'p'", "return ans", "ans", "print(solve())", "print", "solve()", "solve", "def solve():\n S = input()\n even = S[0::2]\n odd = S[1::2]\n ans = odd.count('g')-even.count('p')\n return ans", "def solve():\n S = input()\n even = S[0::2]\n odd = S[1::2]\n ans = odd.count('g')-even.count('p')\n return ans", "solve" ]
def solve(): S = input() even = S[0::2] odd = S[1::2] ans = odd.count('g')-even.count('p') return ans print(solve())
[ 7, 15, 13, 4, 18, 13, 13, 17, 0, 13, 18, 18, 13, 13, 13, 0, 13, 4, 13, 4, 18, 4, 13, 13, 0, 13, 21, 22, 17, 17, 22, 17, 17, 28, 13, 13, 0, 18, 13, 13, 17, 0, 13, 2, 17, 17, 0, 13, 4, 13, 13, 28, 13, 4, 13, 2, 13, 17, 14, 40, 13, 2, 13, 13, 0, 13, 4, 13, 13, 2, 18, 13, 17, 13, 4, 13, 13, 10, 18, 13, 10, 4, 13, 10, 21, 13, 10, 2, 13, 10, 4, 13, 10, 4, 13 ]
[ [ 78, 9 ], [ 93, 16 ], [ 79, 22 ], [ 84, 25 ], [ 35, 34 ], [ 94, 34 ], [ 40, 37 ], [ 85, 38 ], [ 34, 39 ], [ 87, 42 ], [ 90, 47 ], [ 94, 50 ], [ 53, 52 ], [ 91, 56 ], [ 52, 60 ], [ 91, 62 ], [ 52, 63 ], [ 81, 65 ], [ 88, 68 ], [ 82, 68 ], [ 85, 71 ], [ 52, 73 ], [ 82, 76 ], [ 88, 76 ], [ 78, 79 ], [ 81, 82 ], [ 84, 85 ], [ 87, 88 ], [ 90, 91 ], [ 93, 94 ] ]
[ "import sys\nsys.setrecursionlimit(200000)\ninput = sys.stdin.readline\n\nS = list(input().strip())\n\nm = {\n \"g\": 0,\n \"p\": 0,\n}\n\nfor v in S:\n m[v] += 1\n\nans = -10 ** 18\np = len(S)\nfor g in range(p + 1):\n if g >= p - g:\n ans = max(ans, m[\"g\"] - g)\n\nprint(ans)", "import sys", "sys", "sys.setrecursionlimit(200000)", "sys.setrecursionlimit", "sys", "setrecursionlimit", "200000", "input = sys.stdin.readline", "input", "sys.stdin.readline", "sys.stdin", "sys", "stdin", "readline", "S = list(input().strip())", "S", "list(input().strip())", "list", "input().strip()", "().strip", "()", "input", "strip", "m = {\n \"g\": 0,\n \"p\": 0,\n}", "m", "{\n \"g\": 0,\n \"p\": 0,\n}", "\"g\"", "\"g\"", "0", "\"p\"", "\"p\"", "0", "for v in S:\n m[v] += 1", "v", "S", "m[v] += 1", "m[v]", "m", "v", "1", "ans = -10 ** 18", "ans", "-10 ** 18", "-10", "18", "p = len(S)", "p", "len(S)", "len", "S", "for g in range(p + 1):\n if g >= p - g:\n ans = max(ans, m[\"g\"] - g)", "g", "range(p + 1)", "range", "p + 1", "p", "1", "if g >= p - g:\n ans = max(ans, m[\"g\"] - g)", "g >= p - g", "g", "p - g", "p", "g", "ans = max(ans, m[\"g\"] - g)", "ans", "max(ans, m[\"g\"] - g)", "max", "ans", "m[\"g\"] - g", "m[\"g\"]", "m", "\"g\"", "g", "print(ans)", "print", "ans", "input = sys.stdin.readline", "sys.stdin.readline", "input", "ans = max(ans, m[\"g\"] - g)", "max(ans, m[\"g\"] - g)", "ans", "m = {\n \"g\": 0,\n \"p\": 0,\n}", "{\n \"g\": 0,\n \"p\": 0,\n}", "m", "ans = -10 ** 18", "-10 ** 18", "ans", "p = len(S)", "len(S)", "p", "S = list(input().strip())", "list(input().strip())", "S" ]
import sys sys.setrecursionlimit(200000) input = sys.stdin.readline S = list(input().strip()) m = { "g": 0, "p": 0, } for v in S: m[v] += 1 ans = -10 ** 18 p = len(S) for g in range(p + 1): if g >= p - g: ans = max(ans, m["g"] - g) print(ans)
[ 7, 15, 4, 13, 2, 17, 17, 0, 13, 18, 13, 13, 0, 13, 4, 18, 4, 13, 13, 0, 13, 17, 13, 17, 0, 13, 17, 13, 17, 28, 13, 13, 14, 2, 13, 17, 14, 40, 2, 13, 17, 13, 0, 13, 17, 0, 13, 17, 0, 13, 17, 14, 40, 2, 13, 17, 13, 0, 13, 17, 0, 13, 17, 0, 13, 17, 4, 13, 2, 13, 13, 10, 18, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13 ]
[ [ 72, 8 ], [ 78, 13 ], [ 73, 17 ], [ 84, 20 ], [ 93, 22 ], [ 99, 25 ], [ 75, 27 ], [ 31, 30 ], [ 79, 30 ], [ 30, 34 ], [ 94, 39 ], [ 97, 39 ], [ 88, 39 ], [ 85, 41 ], [ 103, 41 ], [ 82, 41 ], [ 87, 43 ], [ 90, 46 ], [ 81, 49 ], [ 94, 54 ], [ 97, 54 ], [ 88, 54 ], [ 85, 56 ], [ 103, 56 ], [ 82, 56 ], [ 96, 58 ], [ 102, 61 ], [ 105, 64 ], [ 91, 69 ], [ 100, 69 ], [ 106, 70 ], [ 76, 70 ], [ 72, 73 ], [ 75, 76 ], [ 78, 79 ], [ 81, 82 ], [ 84, 85 ], [ 87, 88 ], [ 90, 91 ], [ 93, 94 ], [ 96, 97 ], [ 99, 100 ], [ 102, 103 ], [ 105, 106 ] ]
[ "#import pysnooper\n#import os,re,sys,operator,math,heapq,string\n#from collections import Counter,deque\n#from operator import itemgetter\n#from itertools import accumulate,combinations,groupby,combinations_with_replacement\nfrom sys import stdin,setrecursionlimit\n#from copy import deepcopy\n\nsetrecursionlimit(10**6)\ninput=stdin.readline\n\ns=input().rstrip()\ngu,pa=0,0\nwin,lose=0,0\nfor i in s:\n if i==\"g\":\n if pa+1<=gu:\n pa+=1\n win+=1\n else:\n gu+=1\n else:\n if pa+1<=gu:\n pa+=1\n else:\n gu+=1\n lose+=1\nprint(win-lose)", "from sys import stdin,setrecursionlimit", "setrecursionlimit(10**6)", "setrecursionlimit", "10**6", "10", "6", "input=stdin.readline", "input", "stdin.readline", "stdin", "readline", "s=input().rstrip()", "s", "input().rstrip()", "().rstrip", "()", "input", "rstrip", "gu,pa=0,0", "gu", "0", "pa", "0", "win,lose=0,0", "win", "0", "lose", "0", "for i in s:\n if i==\"g\":\n if pa+1<=gu:\n pa+=1\n win+=1\n else:\n gu+=1\n else:\n if pa+1<=gu:\n pa+=1\n else:\n gu+=1\n lose+=1", "i", "s", "if i==\"g\":\n if pa+1<=gu:\n pa+=1\n win+=1\n else:\n gu+=1\n else:\n if pa+1<=gu:\n pa+=1\n else:\n gu+=1\n lose+=1", "i==\"g\"", "i", "\"g\"", "if pa+1<=gu:\n pa+=1\n win+=1\n else:\n gu+=1\n ", "pa+1<=gu", "pa+1", "pa", "1", "gu", "pa+=1", "pa", "1", "win+=1", "win", "1", "gu+=1", "gu", "1", "if pa+1<=gu:\n pa+=1\n else:\n gu+=1\n lose+=1", "pa+1<=gu", "pa+1", "pa", "1", "gu", "pa+=1", "pa", "1", "gu+=1", "gu", "1", "lose+=1", "lose", "1", "print(win-lose)", "print", "win-lose", "win", "lose", "input=stdin.readline", "stdin.readline", "input", "lose=0,0", "0", "lose", "s=input().rstrip()", "input().rstrip()", "s", "gu+=1", "1", "gu", "gu,pa=0,0", "0", "gu", "pa+=1", "1", "pa", "win+=1", "1", "win", "pa=0,0", "0", "pa", "pa+=1", "1", "pa", "win,lose=0,0", "0", "win", "gu+=1", "1", "gu", "lose+=1", "1", "lose" ]
#import pysnooper #import os,re,sys,operator,math,heapq,string #from collections import Counter,deque #from operator import itemgetter #from itertools import accumulate,combinations,groupby,combinations_with_replacement from sys import stdin,setrecursionlimit #from copy import deepcopy setrecursionlimit(10**6) input=stdin.readline s=input().rstrip() gu,pa=0,0 win,lose=0,0 for i in s: if i=="g": if pa+1<=gu: pa+=1 win+=1 else: gu+=1 else: if pa+1<=gu: pa+=1 else: gu+=1 lose+=1 print(win-lose)
[ 7, 0, 13, 4, 13, 0, 13, 17, 0, 13, 17, 28, 13, 13, 14, 2, 13, 17, 14, 40, 13, 17, 0, 13, 17, 0, 13, 17, 0, 13, 17, 14, 40, 13, 17, 0, 13, 17, 0, 13, 17, 0, 13, 17, 4, 13, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13 ]
[ [ 63, 2 ], [ 60, 6 ], [ 48, 9 ], [ 13, 12 ], [ 64, 12 ], [ 12, 16 ], [ 49, 20 ], [ 73, 20 ], [ 67, 20 ], [ 70, 20 ], [ 55, 20 ], [ 54, 23 ], [ 51, 26 ], [ 69, 29 ], [ 49, 33 ], [ 73, 33 ], [ 67, 33 ], [ 70, 33 ], [ 55, 33 ], [ 66, 36 ], [ 72, 39 ], [ 57, 42 ], [ 58, 46 ], [ 52, 46 ], [ 61, 46 ], [ 48, 49 ], [ 51, 52 ], [ 54, 55 ], [ 57, 58 ], [ 60, 61 ], [ 63, 64 ], [ 66, 67 ], [ 69, 70 ], [ 72, 73 ] ]
[ "s = input()\n\nans = 0\ncnt = 0\nfor i in s:\n if i == \"g\":\n if cnt >= 1:\n cnt -= 1\n ans += 1\n else:\n cnt += 1\n else:\n if cnt >= 1:\n cnt -= 1\n else:\n cnt += 1\n ans -= 1\n\nprint(ans)", "s = input()", "s", "input()", "input", "ans = 0", "ans", "0", "cnt = 0", "cnt", "0", "for i in s:\n if i == \"g\":\n if cnt >= 1:\n cnt -= 1\n ans += 1\n else:\n cnt += 1\n else:\n if cnt >= 1:\n cnt -= 1\n else:\n cnt += 1\n ans -= 1", "i", "s", "if i == \"g\":\n if cnt >= 1:\n cnt -= 1\n ans += 1\n else:\n cnt += 1\n else:\n if cnt >= 1:\n cnt -= 1\n else:\n cnt += 1\n ans -= 1", "i == \"g\"", "i", "\"g\"", "if cnt >= 1:\n cnt -= 1\n ans += 1\n else:\n cnt += 1\n ", "cnt >= 1", "cnt", "1", "cnt -= 1", "cnt", "1", "ans += 1", "ans", "1", "cnt += 1", "cnt", "1", "if cnt >= 1:\n cnt -= 1\n else:\n cnt += 1\n ans -= 1", "cnt >= 1", "cnt", "1", "cnt -= 1", "cnt", "1", "cnt += 1", "cnt", "1", "ans -= 1", "ans", "1", "print(ans)", "print", "ans", "cnt = 0", "0", "cnt", "ans += 1", "1", "ans", "cnt -= 1", "1", "cnt", "ans -= 1", "1", "ans", "ans = 0", "0", "ans", "s = input()", "input()", "s", "cnt -= 1", "1", "cnt", "cnt += 1", "1", "cnt", "cnt += 1", "1", "cnt" ]
s = input() ans = 0 cnt = 0 for i in s: if i == "g": if cnt >= 1: cnt -= 1 ans += 1 else: cnt += 1 else: if cnt >= 1: cnt -= 1 else: cnt += 1 ans -= 1 print(ans)
[ 7, 0, 13, 4, 13, 4, 13, 0, 13, 4, 13, 13, 0, 13, 17, 28, 13, 4, 13, 13, 14, 2, 2, 13, 17, 17, 14, 2, 18, 13, 13, 17, 0, 13, 17, 14, 2, 18, 13, 13, 17, 0, 13, 17, 4, 13, 13, 10, 4, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13, 10, 17, 13 ]
[ [ 54, 2 ], [ 48, 8 ], [ 55, 11 ], [ 51, 13 ], [ 17, 16 ], [ 49, 19 ], [ 16, 23 ], [ 55, 29 ], [ 16, 30 ], [ 57, 33 ], [ 55, 38 ], [ 16, 39 ], [ 60, 42 ], [ 61, 46 ], [ 58, 46 ], [ 52, 46 ], [ 48, 49 ], [ 51, 52 ], [ 54, 55 ], [ 57, 58 ], [ 60, 61 ] ]
[ "s=list(input())\nn=len(s)\ncount=0\nfor i in range(n):\n if i%2==0:\n if s[i]==\"p\":\n count-=1\n else:\n if s[i]==\"g\":\n count+=1\nprint(count)", "s=list(input())", "s", "list(input())", "list", "input()", "input", "n=len(s)", "n", "len(s)", "len", "s", "count=0", "count", "0", "for i in range(n):\n if i%2==0:\n if s[i]==\"p\":\n count-=1\n else:\n if s[i]==\"g\":\n count+=1", "i", "range(n)", "range", "n", "if i%2==0:\n if s[i]==\"p\":\n count-=1\n else:\n if s[i]==\"g\":\n count+=1", "i%2==0", "i%2", "i", "2", "0", "if s[i]==\"p\":\n count-=1\n ", "s[i]==\"p\"", "s[i]", "s", "i", "\"p\"", "count-=1", "count", "1", "if s[i]==\"g\":\n count+=1", "s[i]==\"g\"", "s[i]", "s", "i", "\"g\"", "count+=1", "count", "1", "print(count)", "print", "count", "n=len(s)", "len(s)", "n", "count=0", "0", "count", "s=list(input())", "list(input())", "s", "count-=1", "1", "count", "count+=1", "1", "count" ]
s=list(input()) n=len(s) count=0 for i in range(n): if i%2==0: if s[i]=="p": count-=1 else: if s[i]=="g": count+=1 print(count)
[ 7, 15, 13, 0, 13, 4, 13, 0, 13, 4, 18, 13, 13, 17, 14, 2, 2, 4, 13, 13, 17, 13, 4, 13, 17, 4, 18, 13, 13, 14, 2, 2, 4, 13, 13, 17, 17, 0, 13, 2, 13, 2, 4, 13, 13, 17, 0, 13, 2, 13, 2, 2, 4, 13, 13, 17, 17, 4, 13, 4, 13, 13, 10, 4, 13, 10, 4, 13, 10, 2, 13, 10, 2, 13 ]
[ [ 63, 4 ], [ 66, 8 ], [ 64, 11 ], [ 64, 19 ], [ 67, 21 ], [ 64, 34 ], [ 72, 38 ], [ 67, 40 ], [ 64, 44 ], [ 69, 47 ], [ 67, 49 ], [ 64, 54 ], [ 70, 61 ], [ 73, 61 ], [ 63, 64 ], [ 66, 67 ], [ 69, 70 ], [ 72, 73 ] ]
[ "import sys\ns=input()\n\na=s.count('g')\nif len(s)/2==a:\n print('0')\n sys.exit()\n\nif len(s)%2==0:\n p=a-len(s)/2\nelse:\n p=a-(len(s)+1)/2\nprint(int(p))", "import sys", "sys", "s=input()", "s", "input()", "input", "a=s.count('g')", "a", "s.count('g')", "s.count", "s", "count", "'g'", "if len(s)/2==a:\n print('0')\n sys.exit()", "len(s)/2==a", "len(s)/2", "len(s)", "len", "s", "2", "a", "print('0')", "print", "'0'", "sys.exit()", "sys.exit", "sys", "exit", "if len(s)%2==0:\n p=a-len(s)/2\nelse:\n p=a-(len(s)+1)/2", "len(s)%2==0", "len(s)%2", "len(s)", "len", "s", "2", "0", "p=a-len(s)/2", "p", "a-len(s)/2", "a", "len(s)/2", "len(s)", "len", "s", "2", "p=a-(len(s)+1)/2", "p", "a-(len(s)+1)/2", "a", "(len(s)+1)/2", "len(s)+1", "len(s)", "len", "s", "1", "2", "print(int(p))", "print", "int(p)", "int", "p", "s=input()", "input()", "s", "a=s.count('g')", "s.count('g')", "a", "p=a-(len(s)+1)/2", "a-(len(s)+1)/2", "p", "p=a-len(s)/2", "a-len(s)/2", "p" ]
import sys s=input() a=s.count('g') if len(s)/2==a: print('0') sys.exit() if len(s)%2==0: p=a-len(s)/2 else: p=a-(len(s)+1)/2 print(int(p))
[ 7, 0, 13, 4, 13, 0, 13, 17, 0, 13, 17, 0, 13, 17, 28, 13, 13, 14, 2, 13, 17, 14, 2, 13, 13, 0, 13, 17, 0, 13, 17, 0, 13, 17, 14, 2, 13, 13, 0, 13, 17, 0, 13, 17, 0, 13, 17, 4, 13, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 4, 13 ]
[ [ 78, 2 ], [ 72, 6 ], [ 57, 9 ], [ 51, 12 ], [ 16, 15 ], [ 79, 15 ], [ 15, 19 ], [ 58, 23 ], [ 76, 23 ], [ 61, 23 ], [ 52, 24 ], [ 70, 24 ], [ 67, 24 ], [ 66, 26 ], [ 60, 29 ], [ 63, 32 ], [ 58, 36 ], [ 76, 36 ], [ 61, 36 ], [ 52, 37 ], [ 70, 37 ], [ 67, 37 ], [ 69, 39 ], [ 54, 42 ], [ 75, 45 ], [ 55, 49 ], [ 64, 49 ], [ 73, 49 ], [ 51, 52 ], [ 54, 55 ], [ 57, 58 ], [ 60, 61 ], [ 63, 64 ], [ 66, 67 ], [ 69, 70 ], [ 72, 73 ], [ 75, 76 ], [ 78, 79 ] ]
[ "s = input()\nans = 0\np = 0\ng = 0\nfor e in s:\n if e=='g':\n if p==g:\n g += 1\n else:\n p += 1\n ans += 1\n else:\n if p==g:\n g += 1\n ans -= 1\n else:\n p += 1\nprint(ans)", "s = input()", "s", "input()", "input", "ans = 0", "ans", "0", "p = 0", "p", "0", "g = 0", "g", "0", "for e in s:\n if e=='g':\n if p==g:\n g += 1\n else:\n p += 1\n ans += 1\n else:\n if p==g:\n g += 1\n ans -= 1\n else:\n p += 1", "e", "s", "if e=='g':\n if p==g:\n g += 1\n else:\n p += 1\n ans += 1\n else:\n if p==g:\n g += 1\n ans -= 1\n else:\n p += 1", "e=='g'", "e", "'g'", "if p==g:\n g += 1\n else:\n p += 1\n ans += 1\n ", "p==g", "p", "g", "g += 1", "g", "1", "p += 1", "p", "1", "ans += 1", "ans", "1", "if p==g:\n g += 1\n ans -= 1\n else:\n p += 1", "p==g", "p", "g", "g += 1", "g", "1", "ans -= 1", "ans", "1", "p += 1", "p", "1", "print(ans)", "print", "ans", "g = 0", "0", "g", "ans -= 1", "1", "ans", "p = 0", "0", "p", "p += 1", "1", "p", "ans += 1", "1", "ans", "g += 1", "1", "g", "g += 1", "1", "g", "ans = 0", "0", "ans", "p += 1", "1", "p", "s = input()", "input()", "s" ]
s = input() ans = 0 p = 0 g = 0 for e in s: if e=='g': if p==g: g += 1 else: p += 1 ans += 1 else: if p==g: g += 1 ans -= 1 else: p += 1 print(ans)
[ 7, 0, 13, 4, 13, 0, 13, 17, 13, 17, 0, 13, 17, 28, 13, 13, 14, 2, 13, 17, 14, 40, 2, 13, 17, 13, 0, 13, 17, 0, 13, 17, 0, 13, 17, 0, 13, 17, 14, 40, 2, 13, 17, 13, 0, 13, 17, 0, 13, 17, 0, 13, 17, 0, 13, 17, 4, 13, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13, 10, 17, 13 ]
[ [ 87, 2 ], [ 84, 6 ], [ 63, 8 ], [ 90, 11 ], [ 15, 14 ], [ 88, 14 ], [ 14, 18 ], [ 85, 23 ], [ 61, 23 ], [ 67, 23 ], [ 64, 25 ], [ 94, 25 ], [ 70, 25 ], [ 75, 27 ], [ 66, 30 ], [ 78, 33 ], [ 69, 36 ], [ 85, 41 ], [ 61, 41 ], [ 67, 41 ], [ 64, 43 ], [ 94, 43 ], [ 70, 43 ], [ 72, 45 ], [ 60, 48 ], [ 81, 51 ], [ 93, 54 ], [ 82, 58 ], [ 73, 58 ], [ 79, 58 ], [ 76, 58 ], [ 91, 58 ], [ 60, 61 ], [ 63, 64 ], [ 66, 67 ], [ 69, 70 ], [ 72, 73 ], [ 75, 76 ], [ 78, 79 ], [ 81, 82 ], [ 84, 85 ], [ 87, 88 ], [ 90, 91 ], [ 93, 94 ] ]
[ "s=(input())\npap,rk=0,0\nsm=0\nfor el in s:\n if(el=='g'):#rock\n if(pap+1<=rk):\n sm+=1\n pap+=1\n else:\n sm+=0\n rk+=1\n else:\n if(pap+1<=rk):\n sm+=0\n pap+=1\n else:\n sm-=1\n rk+=1\nprint(sm)", "s=(input())", "s", "input()", "input", "pap,rk=0,0", "pap", "0", "rk", "0", "sm=0", "sm", "0", "for el in s:\n if(el=='g'):#rock\n if(pap+1<=rk):\n sm+=1\n pap+=1\n else:\n sm+=0\n rk+=1\n else:\n if(pap+1<=rk):\n sm+=0\n pap+=1\n else:\n sm-=1\n rk+=1", "el", "s", "if(el=='g'):#rock\n if(pap+1<=rk):\n sm+=1\n pap+=1\n else:\n sm+=0\n rk+=1\n else:\n if(pap+1<=rk):\n sm+=0\n pap+=1\n else:\n sm-=1\n rk+=1", "el=='g'", "el", "'g'", "if(pap+1<=rk):\n sm+=1\n pap+=1\n else:\n sm+=0\n rk+=1\n ", "pap+1<=rk", "pap+1", "pap", "1", "rk", "sm+=1", "sm", "1", "pap+=1", "pap", "1", "sm+=0", "sm", "0", "rk+=1", "rk", "1", "if(pap+1<=rk):\n sm+=0\n pap+=1\n else:\n sm-=1\n rk+=1", "pap+1<=rk", "pap+1", "pap", "1", "rk", "sm+=0", "sm", "0", "pap+=1", "pap", "1", "sm-=1", "sm", "1", "rk+=1", "rk", "1", "print(sm)", "print", "sm", "pap+=1", "1", "pap", "rk=0,0", "0", "rk", "pap+=1", "1", "pap", "rk+=1", "1", "rk", "sm+=0", "0", "sm", "sm+=1", "1", "sm", "sm+=0", "0", "sm", "sm-=1", "1", "sm", "pap,rk=0,0", "0", "pap", "s=(input())", "input()", "s", "sm=0", "0", "sm", "rk+=1", "1", "rk" ]
s=(input()) pap,rk=0,0 sm=0 for el in s: if(el=='g'):#rock if(pap+1<=rk): sm+=1 pap+=1 else: sm+=0 rk+=1 else: if(pap+1<=rk): sm+=0 pap+=1 else: sm-=1 rk+=1 print(sm)
[ 7, 0, 13, 4, 13, 4, 13, 0, 13, 4, 13, 13, 0, 13, 17, 0, 13, 17, 28, 13, 4, 13, 13, 14, 2, 2, 13, 17, 17, 0, 13, 17, 14, 40, 13, 18, 13, 13, 0, 13, 17, 14, 40, 13, 18, 13, 13, 0, 13, 2, 13, 13, 4, 13, 13, 10, 17, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13, 10, 2, 13, 10, 4, 13, 10, 17, 13 ]
[ [ 62, 2 ], [ 71, 8 ], [ 63, 11 ], [ 74, 13 ], [ 56, 16 ], [ 20, 19 ], [ 72, 22 ], [ 19, 26 ], [ 65, 30 ], [ 66, 34 ], [ 60, 34 ], [ 63, 36 ], [ 19, 37 ], [ 59, 39 ], [ 60, 43 ], [ 66, 43 ], [ 63, 45 ], [ 19, 46 ], [ 68, 48 ], [ 75, 50 ], [ 57, 51 ], [ 69, 54 ], [ 56, 57 ], [ 59, 60 ], [ 62, 63 ], [ 65, 66 ], [ 68, 69 ], [ 71, 72 ], [ 74, 75 ] ]
[ "s = list(input())\nN = len(s)\n\n#(方針)パーが使えるようになった瞬間パー使用 → gpgpgpgp...\nwin = 0\nlose = 0\nfor i in range(N):\n if(i%2 == 0): #奇数回目 g\n my_hand = 'g'\n if(my_hand != s[i]): lose += 1 #負け\n else: #偶数回目 p\n my_hand = 'p'\n if(my_hand != s[i]): win += 1 #負け\n \nans = win-lose\nprint(ans)", "s = list(input())", "s", "list(input())", "list", "input()", "input", "N = len(s)", "N", "len(s)", "len", "s", "win = 0", "win", "0", "lose = 0", "lose", "0", "for i in range(N):\n if(i%2 == 0): #奇数回目 g\n my_hand = 'g'\n if(my_hand != s[i]): lose += 1 #負け\n else: #偶数回目 p\n my_hand = 'p'\n if(my_hand != s[i]): win += 1 #負け\n ", "i", "range(N)", "range", "N", "if(i%2 == 0): #奇数回目 g\n my_hand = 'g'\n if(my_hand != s[i]): lose += 1 #負け\n else: #偶数回目 p\n my_hand = 'p'\n if(my_hand != s[i]): win += 1 #負け\n ", "i%2 == 0", "i%2", "i", "2", "0", "my_hand = 'g'", "my_hand", "'g'", "if(my_hand != s[i]): lose += 1 #負け\n ", "my_hand != s[i]", "my_hand", "s[i]", "s", "i", "my_hand = 'p'", "my_hand", "'p'", "if(my_hand != s[i]): win += 1 #負け\n ", "my_hand != s[i]", "my_hand", "s[i]", "s", "i", "ans = win-lose", "ans", "win-lose", "win", "lose", "print(ans)", "print", "ans", "lose = 0", "0", "lose", "my_hand = 'p'", "'p'", "my_hand", "s = list(input())", "list(input())", "s", "my_hand = 'g'", "'g'", "my_hand", "ans = win-lose", "win-lose", "ans", "N = len(s)", "len(s)", "N", "win = 0", "0", "win" ]
s = list(input()) N = len(s) #(方針)パーが使えるようになった瞬間パー使用 → gpgpgpgp... win = 0 lose = 0 for i in range(N): if(i%2 == 0): #奇数回目 g my_hand = 'g' if(my_hand != s[i]): lose += 1 #負け else: #偶数回目 p my_hand = 'p' if(my_hand != s[i]): win += 1 #負け ans = win-lose print(ans)
[ 7, 12, 13, 29, 4, 13, 4, 13, 13, 4, 18, 4, 13, 13, 0, 13, 4, 13, 4, 13, 2, 2, 4, 13, 13, 17, 4, 18, 13, 13, 17, 10, 12, 13, 10, 4, 13 ]
[ [ 35, 15 ], [ 36, 24 ], [ 36, 28 ], [ 35, 36 ] ]
[ "def inpl():\n return list(map(int, input().split()))\n\n\nS = input()\n\nprint(len(S) // 2 - S.count('p'))", "def inpl():\n return list(map(int, input().split()))", "inpl", "return list(map(int, input().split()))", "list(map(int, input().split()))", "list", "map(int, input().split())", "map", "int", "input().split()", "().split", "()", "input", "split", "S = input()", "S", "input()", "input", "print(len(S) // 2 - S.count('p'))", "print", "len(S) // 2 - S.count('p')", "len(S) // 2", "len(S)", "len", "S", "2", "S.count('p')", "S.count", "S", "count", "'p'", "def inpl():\n return list(map(int, input().split()))", "def inpl():\n return list(map(int, input().split()))", "inpl", "S = input()", "input()", "S" ]
def inpl(): return list(map(int, input().split())) S = input() print(len(S) // 2 - S.count('p'))
[ 7, 15, 15, 15, 12, 13, 0, 13, 4, 13, 0, 13, 4, 13, 13, 0, 13, 17, 0, 13, 17, 28, 13, 4, 13, 13, 14, 2, 18, 13, 13, 17, 0, 13, 17, 0, 13, 17, 4, 13, 2, 2, 13, 13, 17, 14, 2, 13, 17, 4, 13, 10, 12, 13 ]
[ [ 8, 7 ], [ 12, 11 ], [ 7, 14 ], [ 17, 16 ], [ 20, 19 ], [ 23, 22 ], [ 11, 25 ], [ 7, 29 ], [ 22, 30 ], [ 34, 33 ], [ 37, 36 ], [ 33, 42 ], [ 16, 42 ], [ 36, 43 ], [ 19, 43 ], [ 53, 50 ] ]
[ "#!/usr/bin/env python3\nfrom collections import deque, Counter\nfrom heapq import heappop, heappush\nfrom bisect import bisect_right\n\ndef main():\n s = input()\n N = len(s)\n gnum = 0\n pnum = 0\n for i in range(N):\n if s[i] == 'g':\n gnum += 1\n else:\n pnum += 1\n print((gnum-pnum)//2)\n\nif __name__ == \"__main__\":\n main()", "from collections import deque, Counter", "from heapq import heappop, heappush", "from bisect import bisect_right", "def main():\n s = input()\n N = len(s)\n gnum = 0\n pnum = 0\n for i in range(N):\n if s[i] == 'g':\n gnum += 1\n else:\n pnum += 1\n print((gnum-pnum)//2)", "main", "s = input()", "s", "input()", "input", "N = len(s)", "N", "len(s)", "len", "s", "gnum = 0", "gnum", "0", "pnum = 0", "pnum", "0", "for i in range(N):\n if s[i] == 'g':\n gnum += 1\n else:\n pnum += 1\n ", "i", "range(N)", "range", "N", "if s[i] == 'g':\n gnum += 1\n else:\n pnum += 1\n ", "s[i] == 'g'", "s[i]", "s", "i", "'g'", "gnum += 1", "gnum", "1", "pnum += 1", "pnum", "1", "print((gnum-pnum)//2)", "print", "(gnum-pnum)//2", "gnum-pnum", "gnum", "pnum", "2", "if __name__ == \"__main__\":\n main()", "__name__ == \"__main__\"", "__name__", "\"__main__\"", "main()", "main", "def main():\n s = input()\n N = len(s)\n gnum = 0\n pnum = 0\n for i in range(N):\n if s[i] == 'g':\n gnum += 1\n else:\n pnum += 1\n print((gnum-pnum)//2)", "def main():\n s = input()\n N = len(s)\n gnum = 0\n pnum = 0\n for i in range(N):\n if s[i] == 'g':\n gnum += 1\n else:\n pnum += 1\n print((gnum-pnum)//2)", "main" ]
#!/usr/bin/env python3 from collections import deque, Counter from heapq import heappop, heappush from bisect import bisect_right def main(): s = input() N = len(s) gnum = 0 pnum = 0 for i in range(N): if s[i] == 'g': gnum += 1 else: pnum += 1 print((gnum-pnum)//2) if __name__ == "__main__": main()
[ 7, 15, 13, 0, 13, 18, 18, 18, 13, 13, 13, 13, 0, 13, 18, 18, 18, 13, 13, 13, 13, 0, 13, 18, 18, 18, 13, 13, 13, 13, 4, 18, 13, 13, 2, 17, 17, 0, 13, 4, 13, 0, 13, 17, 0, 13, 17, 0, 13, 4, 13, 13, 0, 13, 17, 28, 13, 4, 13, 13, 14, 40, 13, 2, 13, 13, 0, 13, 17, 14, 2, 18, 13, 13, 17, 0, 13, 17, 14, 2, 18, 13, 13, 17, 14, 13, 0, 13, 17, 0, 13, 17, 14, 13, 4, 13, 13, 4, 13, 4, 13, 13, 17, 10, 17, 13, 10, 18, 13, 10, 18, 13, 10, 4, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 18, 13 ]
[ [ 107, 4 ], [ 110, 13 ], [ 137, 22 ], [ 113, 38 ], [ 116, 42 ], [ 104, 45 ], [ 125, 48 ], [ 114, 51 ], [ 134, 53 ], [ 57, 56 ], [ 126, 59 ], [ 117, 62 ], [ 123, 62 ], [ 120, 62 ], [ 126, 64 ], [ 56, 65 ], [ 128, 67 ], [ 114, 72 ], [ 56, 73 ], [ 119, 76 ], [ 114, 81 ], [ 56, 82 ], [ 131, 87 ], [ 122, 90 ], [ 132, 96 ], [ 105, 96 ], [ 123, 101 ], [ 120, 101 ], [ 117, 101 ], [ 104, 105 ], [ 107, 108 ], [ 110, 111 ], [ 113, 114 ], [ 116, 117 ], [ 119, 120 ], [ 122, 123 ], [ 125, 126 ], [ 128, 129 ], [ 131, 132 ], [ 134, 135 ], [ 137, 138 ] ]
[ "import sys\nread = sys.stdin.buffer.read\nreadline = sys.stdin.buffer.readline\nreadlines = sys.stdin.buffer.readlines\nsys.setrecursionlimit(10 ** 7)\n\ns = input()\ncnt = 0\nans = 0\nsize = len(s)\nflag = False\nfor i in range(size):\n if cnt >= size - i:\n flag = True\n if s[i] == 'p':\n cnt -= 1\n if s[i] == 'g':\n if flag:\n ans += 1\n else:\n cnt += 1\nif flag:\n print(ans)\nelse:\n print(min(cnt, 0))", "import sys", "sys", "read = sys.stdin.buffer.read", "read", "sys.stdin.buffer.read", "sys.stdin.buffer", "sys.stdin", "sys", "stdin", "buffer", "read", "readline = sys.stdin.buffer.readline", "readline", "sys.stdin.buffer.readline", "sys.stdin.buffer", "sys.stdin", "sys", "stdin", "buffer", "readline", "readlines = sys.stdin.buffer.readlines", "readlines", "sys.stdin.buffer.readlines", "sys.stdin.buffer", "sys.stdin", "sys", "stdin", "buffer", "readlines", "sys.setrecursionlimit(10 ** 7)", "sys.setrecursionlimit", "sys", "setrecursionlimit", "10 ** 7", "10", "7", "s = input()", "s", "input()", "input", "cnt = 0", "cnt", "0", "ans = 0", "ans", "0", "size = len(s)", "size", "len(s)", "len", "s", "flag = False", "flag", "False", "for i in range(size):\n if cnt >= size - i:\n flag = True\n if s[i] == 'p':\n cnt -= 1\n if s[i] == 'g':\n if flag:\n ans += 1\n else:\n cnt += 1", "i", "range(size)", "range", "size", "if cnt >= size - i:\n flag = True\n ", "cnt >= size - i", "cnt", "size - i", "size", "i", "flag = True", "flag", "True", "if s[i] == 'p':\n cnt -= 1\n ", "s[i] == 'p'", "s[i]", "s", "i", "'p'", "cnt -= 1", "cnt", "1", "if s[i] == 'g':\n if flag:\n ans += 1\n else:\n cnt += 1", "s[i] == 'g'", "s[i]", "s", "i", "'g'", "if flag:\n ans += 1\n else:\n cnt += 1", "flag", "ans += 1", "ans", "1", "cnt += 1", "cnt", "1", "if flag:\n print(ans)\nelse:\n print(min(cnt, 0))", "flag", "print(ans)", "print", "ans", "print(min(cnt, 0))", "print", "min(cnt, 0)", "min", "cnt", "0", "ans = 0", "0", "ans", "read = sys.stdin.buffer.read", "sys.stdin.buffer.read", "read", "readline = sys.stdin.buffer.readline", "sys.stdin.buffer.readline", "readline", "s = input()", "input()", "s", "cnt = 0", "0", "cnt", "cnt -= 1", "1", "cnt", "cnt += 1", "1", "cnt", "size = len(s)", "len(s)", "size", "flag = True", "True", "flag", "ans += 1", "1", "ans", "flag = False", "False", "flag", "readlines = sys.stdin.buffer.readlines", "sys.stdin.buffer.readlines", "readlines" ]
import sys read = sys.stdin.buffer.read readline = sys.stdin.buffer.readline readlines = sys.stdin.buffer.readlines sys.setrecursionlimit(10 ** 7) s = input() cnt = 0 ans = 0 size = len(s) flag = False for i in range(size): if cnt >= size - i: flag = True if s[i] == 'p': cnt -= 1 if s[i] == 'g': if flag: ans += 1 else: cnt += 1 if flag: print(ans) else: print(min(cnt, 0))
[ 7, 0, 13, 39, 17, 17, 17, 17, 17, 17, 17, 17, 0, 13, 39, 17, 17, 17, 17, 17, 17, 17, 17, 0, 13, 4, 13, 4, 13, 0, 13, 17, 0, 13, 17, 0, 13, 17, 28, 13, 4, 13, 4, 13, 13, 14, 2, 2, 18, 13, 13, 17, 40, 2, 13, 17, 13, 0, 13, 17, 0, 13, 17, 14, 2, 2, 18, 13, 13, 17, 40, 13, 2, 13, 17, 0, 13, 17, 14, 2, 2, 18, 13, 13, 17, 40, 2, 13, 17, 13, 0, 13, 17, 14, 2, 2, 18, 13, 13, 17, 40, 13, 2, 13, 17, 0, 13, 17, 0, 13, 17, 4, 13, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 39, 13, 10, 17, 13, 10, 17, 13, 10, 39, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13 ]
[ [ 124, 2 ], [ 133, 13 ], [ 139, 24 ], [ 142, 30 ], [ 121, 33 ], [ 127, 36 ], [ 40, 39 ], [ 140, 44 ], [ 140, 49 ], [ 39, 50 ], [ 122, 54 ], [ 137, 54 ], [ 116, 54 ], [ 143, 56 ], [ 149, 56 ], [ 131, 56 ], [ 145, 58 ], [ 115, 61 ], [ 140, 67 ], [ 39, 68 ], [ 122, 71 ], [ 137, 71 ], [ 116, 71 ], [ 143, 73 ], [ 149, 73 ], [ 131, 73 ], [ 130, 76 ], [ 140, 82 ], [ 39, 83 ], [ 122, 87 ], [ 137, 87 ], [ 116, 87 ], [ 143, 89 ], [ 149, 89 ], [ 131, 89 ], [ 136, 91 ], [ 140, 97 ], [ 39, 98 ], [ 122, 101 ], [ 137, 101 ], [ 116, 101 ], [ 143, 103 ], [ 149, 103 ], [ 131, 103 ], [ 118, 106 ], [ 148, 109 ], [ 119, 113 ], [ 146, 113 ], [ 128, 113 ], [ 115, 116 ], [ 118, 119 ], [ 121, 122 ], [ 124, 125 ], [ 127, 128 ], [ 130, 131 ], [ 133, 134 ], [ 136, 137 ], [ 139, 140 ], [ 142, 143 ], [ 145, 146 ], [ 148, 149 ] ]
[ "# -*- coding: utf-8 -*-\ndx = [0, 0, 1, -1, 1, -1, -1, 1]\ndy = [1, -1, 0, 0, 1, -1, 1, -1]\n\ns = list(input())\ng = 0\np = 0\nans = 0\nfor i in range(len(s)):\n if s[i] == 'g' and p + 1 <= g:\n ans += 1\n p += 1\n #print('a')\n elif s[i] == 'g' and p <= g + 1:\n g += 1\n #print('b')\n elif s[i] == 'p' and p + 1 <= g:\n p += 1\n #print('d')\n elif s[i] == 'p' and p <= g + 1:\n ans -= 1\n g += 1\n #print('c')\nprint(ans)", "dx = [0, 0, 1, -1, 1, -1, -1, 1]", "dx", "[0, 0, 1, -1, 1, -1, -1, 1]", "0", "0", "1", "-1", "1", "-1", "-1", "1", "dy = [1, -1, 0, 0, 1, -1, 1, -1]", "dy", "[1, -1, 0, 0, 1, -1, 1, -1]", "1", "-1", "0", "0", "1", "-1", "1", "-1", "s = list(input())", "s", "list(input())", "list", "input()", "input", "g = 0", "g", "0", "p = 0", "p", "0", "ans = 0", "ans", "0", "for i in range(len(s)):\n if s[i] == 'g' and p + 1 <= g:\n ans += 1\n p += 1\n #print('a')\n elif s[i] == 'g' and p <= g + 1:\n g += 1\n #print('b')\n elif s[i] == 'p' and p + 1 <= g:\n p += 1\n #print('d')\n elif s[i] == 'p' and p <= g + 1:\n ans -= 1\n g += 1\n #print('c')", "i", "range(len(s))", "range", "len(s)", "len", "s", "if s[i] == 'g' and p + 1 <= g:\n ans += 1\n p += 1\n #print('a')\n elif s[i] == 'g' and p <= g + 1:\n g += 1\n #print('b')\n elif s[i] == 'p' and p + 1 <= g:\n p += 1\n #print('d')\n elif s[i] == 'p' and p <= g + 1:\n ans -= 1\n g += 1\n #print('c')", "s[i] == 'g' and p + 1 <= g", "s[i] == 'g'", "s[i]", "s", "i", "'g'", "p + 1 <= g", "p + 1", "p", "1", "g", "ans += 1", "ans", "1", "p += 1", "p", "1", "elif s[i] == 'g' and p <= g + 1:\n g += 1\n #print('b')\n ", "s[i] == 'g' and p <= g + 1", "s[i] == 'g'", "s[i]", "s", "i", "'g'", "p <= g + 1", "p", "g + 1", "g", "1", "g += 1", "g", "1", "elif s[i] == 'p' and p + 1 <= g:\n p += 1\n #print('d')\n ", "s[i] == 'p' and p + 1 <= g", "s[i] == 'p'", "s[i]", "s", "i", "'p'", "p + 1 <= g", "p + 1", "p", "1", "g", "p += 1", "p", "1", "elif s[i] == 'p' and p <= g + 1:\n ans -= 1\n g += 1\n #print('c')", "s[i] == 'p' and p <= g + 1", "s[i] == 'p'", "s[i]", "s", "i", "'p'", "p <= g + 1", "p", "g + 1", "g", "1", "ans -= 1", "ans", "1", "g += 1", "g", "1", "print(ans)", "print", "ans", "p += 1", "1", "p", "ans -= 1", "1", "ans", "p = 0", "0", "p", "dx = [0, 0, 1, -1, 1, -1, -1, 1]", "[0, 0, 1, -1, 1, -1, -1, 1]", "dx", "ans = 0", "0", "ans", "g += 1", "1", "g", "dy = [1, -1, 0, 0, 1, -1, 1, -1]", "[1, -1, 0, 0, 1, -1, 1, -1]", "dy", "p += 1", "1", "p", "s = list(input())", "list(input())", "s", "g = 0", "0", "g", "ans += 1", "1", "ans", "g += 1", "1", "g" ]
# -*- coding: utf-8 -*- dx = [0, 0, 1, -1, 1, -1, -1, 1] dy = [1, -1, 0, 0, 1, -1, 1, -1] s = list(input()) g = 0 p = 0 ans = 0 for i in range(len(s)): if s[i] == 'g' and p + 1 <= g: ans += 1 p += 1 #print('a') elif s[i] == 'g' and p <= g + 1: g += 1 #print('b') elif s[i] == 'p' and p + 1 <= g: p += 1 #print('d') elif s[i] == 'p' and p <= g + 1: ans -= 1 g += 1 #print('c') print(ans)
[ 7, 15, 12, 13, 0, 13, 18, 13, 13, 0, 13, 4, 18, 4, 13, 13, 0, 13, 17, 28, 13, 4, 13, 4, 13, 13, 14, 2, 2, 13, 17, 17, 14, 2, 18, 13, 13, 17, 0, 13, 17, 14, 2, 18, 13, 13, 17, 0, 13, 17, 4, 13, 13, 14, 2, 13, 17, 4, 13, 10, 12, 13 ]
[ [ 6, 5 ], [ 11, 10 ], [ 5, 14 ], [ 18, 17 ], [ 21, 20 ], [ 10, 25 ], [ 20, 29 ], [ 10, 35 ], [ 20, 36 ], [ 40, 39 ], [ 10, 44 ], [ 20, 45 ], [ 49, 48 ], [ 48, 52 ], [ 39, 52 ], [ 17, 52 ], [ 61, 58 ] ]
[ "from sys import stdin\ndef main():\n readline=stdin.readline\n s=readline().strip()\n\n res=0\n for i in range(len(s)):\n if i%2==0:\n if s[i]==\"g\":\n pass\n else:\n res-=1\n else:\n if s[i]==\"g\":\n res+=1\n else:\n pass\n \n print(res)\n\nif __name__==\"__main__\":\n main()", "from sys import stdin", "def main():\n readline=stdin.readline\n s=readline().strip()\n\n res=0\n for i in range(len(s)):\n if i%2==0:\n if s[i]==\"g\":\n pass\n else:\n res-=1\n else:\n if s[i]==\"g\":\n res+=1\n else:\n pass\n \n print(res)", "main", "readline=stdin.readline", "readline", "stdin.readline", "stdin", "readline", "s=readline().strip()", "s", "readline().strip()", "().strip", "()", "readline", "strip", "res=0", "res", "0", "for i in range(len(s)):\n if i%2==0:\n if s[i]==\"g\":\n pass\n else:\n res-=1\n else:\n if s[i]==\"g\":\n res+=1\n else:\n pass\n \n ", "i", "range(len(s))", "range", "len(s)", "len", "s", "if i%2==0:\n if s[i]==\"g\":\n pass\n else:\n res-=1\n else:\n if s[i]==\"g\":\n res+=1\n else:\n pass\n \n ", "i%2==0", "i%2", "i", "2", "0", "if s[i]==\"g\":\n pass\n else:\n res-=1\n ", "s[i]==\"g\"", "s[i]", "s", "i", "\"g\"", "res-=1", "res", "1", "if s[i]==\"g\":\n res+=1\n else:\n pass\n \n ", "s[i]==\"g\"", "s[i]", "s", "i", "\"g\"", "res+=1", "res", "1", "print(res)", "print", "res", "if __name__==\"__main__\":\n main()", "__name__==\"__main__\"", "__name__", "\"__main__\"", "main()", "main", "def main():\n readline=stdin.readline\n s=readline().strip()\n\n res=0\n for i in range(len(s)):\n if i%2==0:\n if s[i]==\"g\":\n pass\n else:\n res-=1\n else:\n if s[i]==\"g\":\n res+=1\n else:\n pass\n \n print(res)", "def main():\n readline=stdin.readline\n s=readline().strip()\n\n res=0\n for i in range(len(s)):\n if i%2==0:\n if s[i]==\"g\":\n pass\n else:\n res-=1\n else:\n if s[i]==\"g\":\n res+=1\n else:\n pass\n \n print(res)", "main" ]
from sys import stdin def main(): readline=stdin.readline s=readline().strip() res=0 for i in range(len(s)): if i%2==0: if s[i]=="g": pass else: res-=1 else: if s[i]=="g": res+=1 else: pass print(res) if __name__=="__main__": main()
[ 7, 0, 13, 4, 13, 0, 13, 17, 0, 13, 17, 0, 13, 17, 28, 13, 13, 14, 2, 13, 17, 14, 2, 13, 13, 0, 13, 17, 0, 13, 17, 0, 13, 17, 14, 2, 13, 13, 0, 13, 17, 0, 13, 17, 0, 13, 17, 4, 13, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13 ]
[ [ 63, 2 ], [ 57, 6 ], [ 66, 9 ], [ 78, 12 ], [ 16, 15 ], [ 64, 15 ], [ 15, 19 ], [ 58, 23 ], [ 55, 23 ], [ 52, 23 ], [ 67, 24 ], [ 61, 24 ], [ 70, 24 ], [ 51, 26 ], [ 69, 29 ], [ 75, 32 ], [ 58, 36 ], [ 55, 36 ], [ 52, 36 ], [ 67, 37 ], [ 61, 37 ], [ 70, 37 ], [ 54, 39 ], [ 72, 42 ], [ 60, 45 ], [ 73, 49 ], [ 76, 49 ], [ 79, 49 ], [ 51, 52 ], [ 54, 55 ], [ 57, 58 ], [ 60, 61 ], [ 63, 64 ], [ 66, 67 ], [ 69, 70 ], [ 72, 73 ], [ 75, 76 ], [ 78, 79 ] ]
[ "A=input()\ncntg=0\ncntp=0\ncnt=0\nfor i in A:\n if i=='g':\n if cntg==cntp:\n cntg+=1\n else:\n cntp+=1\n cnt+=1\n else:\n if cntg==cntp:\n cntg+=1\n cnt-=1\n else:\n cntp+=1\nprint(cnt)", "A=input()", "A", "input()", "input", "cntg=0", "cntg", "0", "cntp=0", "cntp", "0", "cnt=0", "cnt", "0", "for i in A:\n if i=='g':\n if cntg==cntp:\n cntg+=1\n else:\n cntp+=1\n cnt+=1\n else:\n if cntg==cntp:\n cntg+=1\n cnt-=1\n else:\n cntp+=1", "i", "A", "if i=='g':\n if cntg==cntp:\n cntg+=1\n else:\n cntp+=1\n cnt+=1\n else:\n if cntg==cntp:\n cntg+=1\n cnt-=1\n else:\n cntp+=1", "i=='g'", "i", "'g'", "if cntg==cntp:\n cntg+=1\n else:\n cntp+=1\n cnt+=1\n ", "cntg==cntp", "cntg", "cntp", "cntg+=1", "cntg", "1", "cntp+=1", "cntp", "1", "cnt+=1", "cnt", "1", "if cntg==cntp:\n cntg+=1\n cnt-=1\n else:\n cntp+=1", "cntg==cntp", "cntg", "cntp", "cntg+=1", "cntg", "1", "cnt-=1", "cnt", "1", "cntp+=1", "cntp", "1", "print(cnt)", "print", "cnt", "cntg+=1", "1", "cntg", "cntg+=1", "1", "cntg", "cntg=0", "0", "cntg", "cntp+=1", "1", "cntp", "A=input()", "input()", "A", "cntp=0", "0", "cntp", "cntp+=1", "1", "cntp", "cnt-=1", "1", "cnt", "cnt+=1", "1", "cnt", "cnt=0", "0", "cnt" ]
A=input() cntg=0 cntp=0 cnt=0 for i in A: if i=='g': if cntg==cntp: cntg+=1 else: cntp+=1 cnt+=1 else: if cntg==cntp: cntg+=1 cnt-=1 else: cntp+=1 print(cnt)
[ 7, 15, 13, 15, 13, 15, 13, 15, 13, 15, 13, 15, 13, 15, 15, 15, 12, 13, 12, 13, 12, 13, 0, 13, 4, 13, 0, 13, 4, 18, 13, 13, 17, 4, 13, 2, 2, 4, 13, 13, 17, 13, 10, 12, 13, 10, 4, 13, 10, 4, 13, 10, 12, 13, 10, 12, 13 ]
[ [ 49, 23 ], [ 44, 25 ], [ 46, 27 ], [ 50, 30 ], [ 50, 39 ], [ 47, 41 ], [ 46, 47 ], [ 49, 50 ] ]
[ "import sys\nimport heapq\nimport math\nimport fractions\nimport bisect\nimport itertools\nfrom collections import Counter\nfrom collections import deque\nfrom operator import itemgetter\ndef input(): return sys.stdin.readline().strip()\ndef mp(): return map(int,input().split())\ndef lmp(): return list(map(int,input().split()))\n\ns=input()\np=s.count(\"p\")\nprint(len(s)//2-p)", "import sys", "sys", "import heapq", "heapq", "import math", "math", "import fractions", "fractions", "import bisect", "bisect", "import itertools", "itertools", "from collections import Counter", "from collections import deque", "from operator import itemgetter", "def input(): return sys.stdin.readline().strip()", "input", "def mp(): return map(int,input().split())", "mp", "def lmp(): return list(map(int,input().split()))", "lmp", "s=input()", "s", "input()", "input", "p=s.count(\"p\")", "p", "s.count(\"p\")", "s.count", "s", "count", "\"p\"", "print(len(s)//2-p)", "print", "len(s)//2-p", "len(s)//2", "len(s)", "len", "s", "2", "p", "def input(): return sys.stdin.readline().strip()", "def input(): return sys.stdin.readline().strip()", "input", "p=s.count(\"p\")", "s.count(\"p\")", "p", "s=input()", "input()", "s", "def mp(): return map(int,input().split())", "def mp(): return map(int,input().split())", "mp", "def lmp(): return list(map(int,input().split()))", "def lmp(): return list(map(int,input().split()))", "lmp" ]
import sys import heapq import math import fractions import bisect import itertools from collections import Counter from collections import deque from operator import itemgetter def input(): return sys.stdin.readline().strip() def mp(): return map(int,input().split()) def lmp(): return list(map(int,input().split())) s=input() p=s.count("p") print(len(s)//2-p)
[ 7, 0, 13, 4, 13, 0, 13, 2, 4, 13, 13, 17, 0, 13, 2, 4, 13, 13, 13, 0, 13, 4, 18, 13, 13, 17, 0, 13, 2, 4, 13, 13, 13, 0, 13, 2, 4, 13, 13, 13, 4, 13, 13, 13, 4, 13, 13, 10, 2, 13, 10, 2, 13, 10, 4, 13, 10, 4, 13, 10, 2, 13, 10, 2, 13 ]
[ [ 54, 2 ], [ 51, 6 ], [ 55, 10 ], [ 48, 13 ], [ 55, 17 ], [ 52, 18 ], [ 57, 20 ], [ 55, 23 ], [ 60, 27 ], [ 55, 31 ], [ 58, 32 ], [ 63, 34 ], [ 52, 38 ], [ 61, 39 ], [ 58, 42 ], [ 49, 43 ], [ 64, 46 ], [ 48, 49 ], [ 51, 52 ], [ 54, 55 ], [ 57, 58 ], [ 60, 61 ], [ 63, 64 ] ]
[ "S = input()\npd = len(S) // 2\ngd = len(S) - pd\npt = S.count(\"p\")\ngt = len(S) - pt\n\nscore = min(pd,gt) - min(pt,gd)\nprint(score)", "S = input()", "S", "input()", "input", "pd = len(S) // 2", "pd", "len(S) // 2", "len(S)", "len", "S", "2", "gd = len(S) - pd", "gd", "len(S) - pd", "len(S)", "len", "S", "pd", "pt = S.count(\"p\")", "pt", "S.count(\"p\")", "S.count", "S", "count", "\"p\"", "gt = len(S) - pt", "gt", "len(S) - pt", "len(S)", "len", "S", "pt", "score = min(pd,gt) - min(pt,gd)", "score", "min(pd,gt) - min(pt,gd)", "min(pd,gt)", "min", "pd", "gt", "min(pt,gd)", "min", "pt", "gd", "print(score)", "print", "score", "gd = len(S) - pd", "len(S) - pd", "gd", "pd = len(S) // 2", "len(S) // 2", "pd", "S = input()", "input()", "S", "pt = S.count(\"p\")", "S.count(\"p\")", "pt", "gt = len(S) - pt", "len(S) - pt", "gt", "score = min(pd,gt) - min(pt,gd)", "min(pd,gt) - min(pt,gd)", "score" ]
S = input() pd = len(S) // 2 gd = len(S) - pd pt = S.count("p") gt = len(S) - pt score = min(pd,gt) - min(pt,gd) print(score)
[ 7, 0, 13, 4, 13, 0, 13, 17, 0, 13, 17, 0, 13, 17, 28, 13, 13, 14, 2, 2, 13, 17, 2, 13, 13, 0, 13, 17, 0, 13, 17, 14, 2, 13, 17, 0, 13, 17, 14, 2, 2, 13, 17, 2, 13, 13, 0, 13, 17, 0, 13, 17, 0, 13, 17, 4, 13, 13, 10, 4, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13 ]
[ [ 59, 2 ], [ 68, 6 ], [ 77, 9 ], [ 71, 12 ], [ 16, 15 ], [ 60, 15 ], [ 15, 20 ], [ 78, 23 ], [ 84, 23 ], [ 87, 23 ], [ 72, 24 ], [ 81, 24 ], [ 66, 24 ], [ 74, 26 ], [ 65, 29 ], [ 15, 33 ], [ 86, 36 ], [ 15, 41 ], [ 78, 44 ], [ 84, 44 ], [ 87, 44 ], [ 72, 45 ], [ 81, 45 ], [ 66, 45 ], [ 80, 47 ], [ 62, 50 ], [ 83, 53 ], [ 63, 57 ], [ 75, 57 ], [ 69, 57 ], [ 59, 60 ], [ 62, 63 ], [ 65, 66 ], [ 68, 69 ], [ 71, 72 ], [ 74, 75 ], [ 77, 78 ], [ 80, 81 ], [ 83, 84 ], [ 86, 87 ] ]
[ "s = input()\n#l = s.__len__()\nans = 0\ngt = 0\npt = 0\n\nfor i in s:\n if i == \"g\" and gt > pt:\n ans += 1\n pt += 1\n elif i == \"g\":\n gt += 1\n elif i == \"p\" and gt > pt:\n pt += 1\n else:\n ans -= 1\n gt += 1\nprint(ans)", "s = input()", "s", "input()", "input", "ans = 0", "ans", "0", "gt = 0", "gt", "0", "pt = 0", "pt", "0", "for i in s:\n if i == \"g\" and gt > pt:\n ans += 1\n pt += 1\n elif i == \"g\":\n gt += 1\n elif i == \"p\" and gt > pt:\n pt += 1\n else:\n ans -= 1\n gt += 1", "i", "s", "if i == \"g\" and gt > pt:\n ans += 1\n pt += 1\n elif i == \"g\":\n gt += 1\n elif i == \"p\" and gt > pt:\n pt += 1\n else:\n ans -= 1\n gt += 1", "i == \"g\" and gt > pt", "i == \"g\"", "i", "\"g\"", "gt > pt", "gt", "pt", "ans += 1", "ans", "1", "pt += 1", "pt", "1", "elif i == \"g\":\n gt += 1\n ", "i == \"g\"", "i", "\"g\"", "gt += 1", "gt", "1", "elif i == \"p\" and gt > pt:\n pt += 1\n ", "i == \"p\" and gt > pt", "i == \"p\"", "i", "\"p\"", "gt > pt", "gt", "pt", "pt += 1", "pt", "1", "ans -= 1", "ans", "1", "gt += 1", "gt", "1", "print(ans)", "print", "ans", "s = input()", "input()", "s", "ans -= 1", "1", "ans", "pt += 1", "1", "pt", "ans = 0", "0", "ans", "pt = 0", "0", "pt", "ans += 1", "1", "ans", "gt = 0", "0", "gt", "pt += 1", "1", "pt", "gt += 1", "1", "gt", "gt += 1", "1", "gt" ]
s = input() #l = s.__len__() ans = 0 gt = 0 pt = 0 for i in s: if i == "g" and gt > pt: ans += 1 pt += 1 elif i == "g": gt += 1 elif i == "p" and gt > pt: pt += 1 else: ans -= 1 gt += 1 print(ans)
[ 7, 0, 13, 4, 13, 0, 13, 4, 13, 13, 0, 13, 17, 0, 13, 17, 0, 13, 17, 0, 13, 17, 28, 13, 4, 13, 13, 14, 2, 13, 13, 0, 13, 17, 14, 2, 18, 13, 13, 17, 0, 13, 17, 0, 13, 17, 14, 2, 18, 13, 13, 17, 0, 13, 17, 4, 13, 2, 13, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13, 10, 4, 13 ]
[ [ 82, 2 ], [ 88, 6 ], [ 83, 9 ], [ 61, 11 ], [ 85, 14 ], [ 70, 17 ], [ 73, 20 ], [ 24, 23 ], [ 89, 26 ], [ 62, 29 ], [ 65, 29 ], [ 86, 30 ], [ 68, 30 ], [ 64, 32 ], [ 83, 37 ], [ 23, 38 ], [ 76, 41 ], [ 67, 44 ], [ 83, 49 ], [ 23, 50 ], [ 79, 53 ], [ 80, 58 ], [ 71, 58 ], [ 77, 59 ], [ 74, 59 ], [ 61, 62 ], [ 64, 65 ], [ 67, 68 ], [ 70, 71 ], [ 73, 74 ], [ 76, 77 ], [ 79, 80 ], [ 82, 83 ], [ 85, 86 ], [ 88, 89 ] ]
[ "s=input()\n\nN=len(s)\ng=0\np=0\nw=0\nl=0\n\nfor i in range(N):\n if g==p:\n g+=1\n if s[i]==\"p\":\n l+=1\n else:\n p+=1\n if s[i]==\"g\":\n w+=1\nprint(w-l)", "s=input()", "s", "input()", "input", "N=len(s)", "N", "len(s)", "len", "s", "g=0", "g", "0", "p=0", "p", "0", "w=0", "w", "0", "l=0", "l", "0", "for i in range(N):\n if g==p:\n g+=1\n if s[i]==\"p\":\n l+=1\n else:\n p+=1\n if s[i]==\"g\":\n w+=1", "i", "range(N)", "range", "N", "if g==p:\n g+=1\n if s[i]==\"p\":\n l+=1\n else:\n p+=1\n if s[i]==\"g\":\n w+=1", "g==p", "g", "p", "g+=1", "g", "1", "if s[i]==\"p\":\n l+=1\n ", "s[i]==\"p\"", "s[i]", "s", "i", "\"p\"", "l+=1", "l", "1", "p+=1", "p", "1", "if s[i]==\"g\":\n w+=1", "s[i]==\"g\"", "s[i]", "s", "i", "\"g\"", "w+=1", "w", "1", "print(w-l)", "print", "w-l", "w", "l", "g=0", "0", "g", "g+=1", "1", "g", "p+=1", "1", "p", "w=0", "0", "w", "l=0", "0", "l", "l+=1", "1", "l", "w+=1", "1", "w", "s=input()", "input()", "s", "p=0", "0", "p", "N=len(s)", "len(s)", "N" ]
s=input() N=len(s) g=0 p=0 w=0 l=0 for i in range(N): if g==p: g+=1 if s[i]=="p": l+=1 else: p+=1 if s[i]=="g": w+=1 print(w-l)
[ 7, 15, 13, 12, 13, 15, 15, 0, 13, 4, 13, 13, 0, 13, 4, 13, 13, 29, 2, 4, 13, 2, 13, 17, 18, 13, 17, 23, 13, 12, 13, 12, 13, 28, 13, 18, 13, 13, 28, 13, 4, 18, 13, 13, 27, 13, 0, 13, 4, 13, 0, 13, 4, 13, 13, 4, 13, 4, 13, 13, 12, 13, 15, 13, 4, 18, 13, 13, 14, 2, 13, 17, 4, 13, 10, 12, 13, 10, 12, 13, 10, 12, 13 ]
[ [ 9, 8 ], [ 28, 11 ], [ 14, 13 ], [ 28, 16 ], [ 8, 22 ], [ 13, 25 ], [ 28, 28 ], [ 35, 34 ], [ 40, 39 ], [ 34, 42 ], [ 39, 45 ], [ 48, 47 ], [ 32, 49 ], [ 52, 51 ], [ 47, 54 ], [ 79, 58 ], [ 51, 59 ], [ 76, 73 ] ]
[ "#!/usr/bin/env python3\nimport sys\n\ndef solve(s: str):\n from collections import Counter\n from math import floor\n N = len(s)\n c = Counter(s)\n return floor(N / 2) - c[\"p\"]\n\n# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools\ndef main():\n def iterate_tokens():\n for line in sys.stdin:\n for word in line.split():\n yield word\n tokens = iterate_tokens()\n s = next(tokens) # type: str\n print(solve(s))\n\ndef test():\n import doctest\n doctest.testmod()\n\nif __name__ == '__main__':\n #test()\n main()", "import sys", "sys", "def solve(s: str):\n from collections import Counter\n from math import floor\n N = len(s)\n c = Counter(s)\n return floor(N / 2) - c[\"p\"]\n\n# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools", "solve", "from collections import Counter", "from math import floor", "N = len(s)", "N", "len(s)", "len", "s", "c = Counter(s)", "c", "Counter(s)", "Counter", "s", "return floor(N / 2) - c[\"p\"]", "floor(N / 2) - c[\"p\"]", "floor(N / 2)", "floor", "N / 2", "N", "2", "c[\"p\"]", "c", "\"p\"", "s: str", "s", "def main():\n def iterate_tokens():\n for line in sys.stdin:\n for word in line.split():\n yield word\n tokens = iterate_tokens()\n s = next(tokens) # type: str\n print(solve(s))", "main", "def iterate_tokens():\n for line in sys.stdin:\n for word in line.split():\n yield word\n ", "iterate_tokens", "for line in sys.stdin:\n for word in line.split():\n yield word\n ", "line", "sys.stdin", "sys", "stdin", "for word in line.split():\n yield word\n ", "word", "line.split()", "line.split", "line", "split", "yield word", "word", "tokens = iterate_tokens()", "tokens", "iterate_tokens()", "iterate_tokens", "s = next(tokens)", "s", "next(tokens)", "next", "tokens", "print(solve(s))", "print", "solve(s)", "solve", "s", "def test():\n import doctest\n doctest.testmod()", "test", "import doctest", "doctest", "doctest.testmod()", "doctest.testmod", "doctest", "testmod", "if __name__ == '__main__':\n #test()\n main()", "__name__ == '__main__'", "__name__", "'__main__'", "main()", "main", "def main():\n def iterate_tokens():\n for line in sys.stdin:\n for word in line.split():\n yield word\n tokens = iterate_tokens()\n s = next(tokens) # type: str\n print(solve(s))", "def main():\n def iterate_tokens():\n for line in sys.stdin:\n for word in line.split():\n yield word\n tokens = iterate_tokens()\n s = next(tokens) # type: str\n print(solve(s))", "main", "def solve(s: str):\n from collections import Counter\n from math import floor\n N = len(s)\n c = Counter(s)\n return floor(N / 2) - c[\"p\"]\n\n# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools", "def solve(s: str):\n from collections import Counter\n from math import floor\n N = len(s)\n c = Counter(s)\n return floor(N / 2) - c[\"p\"]\n\n# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools", "solve", "def test():\n import doctest\n doctest.testmod()", "def test():\n import doctest\n doctest.testmod()", "test" ]
#!/usr/bin/env python3 import sys def solve(s: str): from collections import Counter from math import floor N = len(s) c = Counter(s) return floor(N / 2) - c["p"] # Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools def main(): def iterate_tokens(): for line in sys.stdin: for word in line.split(): yield word tokens = iterate_tokens() s = next(tokens) # type: str print(solve(s)) def test(): import doctest doctest.testmod() if __name__ == '__main__': #test() main()
[ 7, 0, 13, 4, 13, 0, 13, 4, 13, 13, 0, 13, 4, 18, 13, 13, 17, 0, 13, 4, 18, 13, 13, 17, 14, 40, 13, 13, 4, 13, 2, 2, 13, 13, 17, 4, 13, 2, 40, 2, 13, 13, 17, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13 ]
[ [ 44, 2 ], [ 50, 6 ], [ 45, 9 ], [ 47, 11 ], [ 45, 14 ], [ 53, 18 ], [ 45, 21 ], [ 48, 26 ], [ 54, 27 ], [ 48, 32 ], [ 54, 33 ], [ 54, 40 ], [ 48, 41 ], [ 44, 45 ], [ 47, 48 ], [ 50, 51 ], [ 53, 54 ] ]
[ "s = input()\nl = len(s)\ng = s.count('g')\np = s.count('p')\nif g >= p:\n print((g - p) // 2)\nelse:\n print(-(p - g) // 2)", "s = input()", "s", "input()", "input", "l = len(s)", "l", "len(s)", "len", "s", "g = s.count('g')", "g", "s.count('g')", "s.count", "s", "count", "'g'", "p = s.count('p')", "p", "s.count('p')", "s.count", "s", "count", "'p'", "if g >= p:\n print((g - p) // 2)\nelse:\n print(-(p - g) // 2)", "g >= p", "g", "p", "print((g - p) // 2)", "print", "(g - p) // 2", "g - p", "g", "p", "2", "print(-(p - g) // 2)", "print", "-(p - g) // 2", "-(p - g)", "p - g", "p", "g", "2", "s = input()", "input()", "s", "g = s.count('g')", "s.count('g')", "g", "l = len(s)", "len(s)", "l", "p = s.count('p')", "s.count('p')", "p" ]
s = input() l = len(s) g = s.count('g') p = s.count('p') if g >= p: print((g - p) // 2) else: print(-(p - g) // 2)
[ 7, 0, 13, 4, 13, 0, 13, 4, 13, 13, 0, 13, 17, 0, 13, 39, 0, 13, 39, 0, 13, 17, 28, 13, 13, 4, 13, 13, 14, 2, 13, 17, 0, 13, 17, 4, 18, 13, 13, 13, 4, 18, 13, 13, 2, 2, 13, 17, 17, 0, 13, 2, 2, 2, 13, 17, 17, 13, 4, 13, 13, 10, 17, 13, 10, 4, 13, 10, 39, 13, 10, 17, 13, 10, 39, 13, 10, 4, 13, 10, 17, 13, 10, 2, 13 ]
[ [ 65, 2 ], [ 77, 6 ], [ 66, 9 ], [ 71, 11 ], [ 68, 14 ], [ 74, 17 ], [ 80, 20 ], [ 66, 27 ], [ 62, 33 ], [ 69, 37 ], [ 63, 39 ], [ 72, 39 ], [ 75, 42 ], [ 83, 50 ], [ 63, 57 ], [ 72, 57 ], [ 84, 60 ], [ 62, 63 ], [ 65, 66 ], [ 68, 69 ], [ 71, 72 ], [ 74, 75 ], [ 77, 78 ], [ 80, 81 ], [ 83, 84 ] ]
[ "s = input()\nlen_s = len(s)\ncnt = 0\nenemy = []\nme = []\nINF = 1e10\nfor i, _s in enumerate(s):\n if _s == \"p\":\n cnt += 1\n enemy.append(cnt)\n me.append((i+1) // 2)\n diff = (i + 1) // 2 - cnt\nprint(diff)", "s = input()", "s", "input()", "input", "len_s = len(s)", "len_s", "len(s)", "len", "s", "cnt = 0", "cnt", "0", "enemy = []", "enemy", "[]", "me = []", "me", "[]", "INF = 1e10", "INF", "1e10", "for i, _s in enumerate(s):\n if _s == \"p\":\n cnt += 1\n enemy.append(cnt)\n me.append((i+1) // 2)\n diff = (i + 1) // 2 - cnt", "i", "_s", "enumerate(s)", "enumerate", "s", "if _s == \"p\":\n cnt += 1\n ", "_s == \"p\"", "_s", "\"p\"", "cnt += 1", "cnt", "1", "enemy.append(cnt)", "enemy.append", "enemy", "append", "cnt", "me.append((i+1) // 2)", "me.append", "me", "append", "(i+1) // 2", "i+1", "i", "1", "2", "diff = (i + 1) // 2 - cnt", "diff", "(i + 1) // 2 - cnt", "(i + 1) // 2", "i + 1", "i", "1", "2", "cnt", "print(diff)", "print", "diff", "cnt += 1", "1", "cnt", "s = input()", "input()", "s", "enemy = []", "[]", "enemy", "cnt = 0", "0", "cnt", "me = []", "[]", "me", "len_s = len(s)", "len(s)", "len_s", "INF = 1e10", "1e10", "INF", "diff = (i + 1) // 2 - cnt", "(i + 1) // 2 - cnt", "diff" ]
s = input() len_s = len(s) cnt = 0 enemy = [] me = [] INF = 1e10 for i, _s in enumerate(s): if _s == "p": cnt += 1 enemy.append(cnt) me.append((i+1) // 2) diff = (i + 1) // 2 - cnt print(diff)
[ 7, 0, 13, 4, 13, 0, 13, 4, 13, 13, 4, 13, 2, 2, 13, 17, 4, 18, 4, 13, 13, 13, 17, 10, 4, 13, 10, 4, 13 ]
[ [ 27, 2 ], [ 24, 6 ], [ 28, 9 ], [ 25, 14 ], [ 28, 20 ], [ 24, 25 ], [ 27, 28 ] ]
[ "s=input()\nn=len(s)\nprint(n//2 - list(s).count('p'))", "s=input()", "s", "input()", "input", "n=len(s)", "n", "len(s)", "len", "s", "print(n//2 - list(s).count('p'))", "print", "n//2 - list(s).count('p')", "n//2", "n", "2", "list(s).count('p')", "(s).count", "(s)", "list", "s", "count", "'p'", "n=len(s)", "len(s)", "n", "s=input()", "input()", "s" ]
s=input() n=len(s) print(n//2 - list(s).count('p'))
[ 7, 0, 13, 4, 13, 0, 13, 39, 13, 39, 28, 13, 4, 13, 4, 13, 13, 14, 2, 2, 13, 17, 17, 0, 13, 17, 13, 17, 28, 13, 13, 14, 2, 13, 17, 28, 13, 13, 14, 2, 13, 17, 4, 13, 2, 13, 13, 10, 39, 13, 10, 17, 13, 10, 17, 13, 10, 4, 13, 10, 39, 13 ]
[ [ 57, 2 ], [ 60, 6 ], [ 48, 8 ], [ 12, 11 ], [ 58, 16 ], [ 11, 20 ], [ 54, 24 ], [ 51, 26 ], [ 30, 29 ], [ 61, 29 ], [ 29, 33 ], [ 37, 36 ], [ 49, 36 ], [ 36, 40 ], [ 55, 45 ], [ 52, 46 ], [ 48, 49 ], [ 51, 52 ], [ 54, 55 ], [ 57, 58 ], [ 60, 61 ] ]
[ "S = input()\n\ne,o = [],[]\nfor i in range(len(S)):\n if i%2 == 0: e.append(S[i])\n else: o.append(S[i])\n\nwin,lose = 0,0\nfor s in e:\n if s == 'p': lose+=1\nfor s in o:\n if s == 'g': win+=1\n\nprint(win-lose)", "S = input()", "S", "input()", "input", "e,o = [],[]", "e", "[]", "o", "[]", "for i in range(len(S)):\n if i%2 == 0: e.append(S[i])\n else: o.append(S[i])", "i", "range(len(S))", "range", "len(S)", "len", "S", "if i%2 == 0: e.append(S[i])\n else: o.append(S[i])", "i%2 == 0", "i%2", "i", "2", "0", "win,lose = 0,0", "win", "0", "lose", "0", "for s in e:\n if s == 'p': lose+=1", "s", "e", "if s == 'p': los", "s == 'p'", "s", "'p'", "for s in o:\n if s == 'g': win+=1", "s", "o", "if s == 'g': wi", "s == 'g'", "s", "'g'", "print(win-lose)", "print", "win-lose", "win", "lose", "o = [],[]", "[]", "o", "lose = 0,0", "0", "lose", "win,lose = 0,0", "0", "win", "S = input()", "input()", "S", "e,o = [],[]", "[]", "e" ]
S = input() e,o = [],[] for i in range(len(S)): if i%2 == 0: e.append(S[i]) else: o.append(S[i]) win,lose = 0,0 for s in e: if s == 'p': lose+=1 for s in o: if s == 'g': win+=1 print(win-lose)
[ 7, 0, 13, 4, 13, 0, 13, 4, 13, 13, 0, 13, 17, 0, 13, 17, 0, 13, 17, 28, 13, 13, 14, 40, 13, 13, 14, 2, 13, 17, 0, 13, 17, 0, 13, 17, 14, 2, 13, 17, 0, 13, 17, 0, 13, 17, 4, 13, 13, 10, 4, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13 ]
[ [ 50, 2 ], [ 71, 6 ], [ 51, 9 ], [ 68, 11 ], [ 62, 14 ], [ 56, 17 ], [ 21, 20 ], [ 72, 20 ], [ 63, 24 ], [ 60, 24 ], [ 69, 25 ], [ 75, 25 ], [ 20, 28 ], [ 65, 31 ], [ 74, 34 ], [ 20, 38 ], [ 53, 41 ], [ 59, 44 ], [ 54, 48 ], [ 66, 48 ], [ 57, 48 ], [ 50, 51 ], [ 53, 54 ], [ 56, 57 ], [ 59, 60 ], [ 62, 63 ], [ 65, 66 ], [ 68, 69 ], [ 71, 72 ], [ 74, 75 ] ]
[ "s_str = input()\ns_list = list(s_str)\ng_count = 0\np_count = 0\nscore = 0\nfor s in s_list:\n if p_count >= g_count:\n if s == \"p\":\n score -= 1\n g_count += 1\n else:\n if s == \"g\":\n score += 1\n p_count += 1\nprint(score)", "s_str = input()", "s_str", "input()", "input", "s_list = list(s_str)", "s_list", "list(s_str)", "list", "s_str", "g_count = 0", "g_count", "0", "p_count = 0", "p_count", "0", "score = 0", "score", "0", "for s in s_list:\n if p_count >= g_count:\n if s == \"p\":\n score -= 1\n g_count += 1\n else:\n if s == \"g\":\n score += 1\n p_count += 1", "s", "s_list", "if p_count >= g_count:\n if s == \"p\":\n score -= 1\n g_count += 1\n else:\n if s == \"g\":\n score += 1\n p_count += 1", "p_count >= g_count", "p_count", "g_count", "if s == \"p\":\n score -= 1\n ", "s == \"p\"", "s", "\"p\"", "score -= 1", "score", "1", "g_count += 1", "g_count", "1", "if s == \"g\":\n score += 1\n ", "s == \"g\"", "s", "\"g\"", "score += 1", "score", "1", "p_count += 1", "p_count", "1", "print(score)", "print", "score", "s_str = input()", "input()", "s_str", "score += 1", "1", "score", "score = 0", "0", "score", "p_count += 1", "1", "p_count", "p_count = 0", "0", "p_count", "score -= 1", "1", "score", "g_count = 0", "0", "g_count", "s_list = list(s_str)", "list(s_str)", "s_list", "g_count += 1", "1", "g_count" ]
s_str = input() s_list = list(s_str) g_count = 0 p_count = 0 score = 0 for s in s_list: if p_count >= g_count: if s == "p": score -= 1 g_count += 1 else: if s == "g": score += 1 p_count += 1 print(score)
[ 7, 0, 13, 4, 13, 4, 13, 2, 2, 4, 13, 13, 17, 4, 18, 13, 13, 17, 10, 4, 13 ]
[ [ 19, 2 ], [ 20, 11 ], [ 20, 15 ], [ 19, 20 ] ]
[ "a=input()\nprint(len(a)//2-a.count('p'))", "a=input()", "a", "input()", "input", "print(len(a)//2-a.count('p'))", "print", "len(a)//2-a.count('p')", "len(a)//2", "len(a)", "len", "a", "2", "a.count('p')", "a.count", "a", "count", "'p'", "a=input()", "input()", "a" ]
a=input() print(len(a)//2-a.count('p'))
[ 7, 0, 13, 4, 13, 0, 13, 17, 28, 13, 13, 4, 13, 13, 14, 2, 2, 13, 17, 17, 14, 2, 13, 17, 0, 13, 17, 14, 2, 13, 17, 0, 13, 17, 4, 13, 13, 10, 4, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13 ]
[ [ 38, 2 ], [ 47, 6 ], [ 39, 13 ], [ 41, 25 ], [ 44, 32 ], [ 45, 36 ], [ 42, 36 ], [ 48, 36 ], [ 38, 39 ], [ 41, 42 ], [ 44, 45 ], [ 47, 48 ] ]
[ "s = input()\ncnt = 0\nfor i, c in enumerate(s):\n if i % 2 == 0:\n if c == 'p':\n cnt -= 1\n else:\n if c == 'g':\n cnt += 1\nprint(cnt)", "s = input()", "s", "input()", "input", "cnt = 0", "cnt", "0", "for i, c in enumerate(s):\n if i % 2 == 0:\n if c == 'p':\n cnt -= 1\n else:\n if c == 'g':\n cnt += 1", "i", "c", "enumerate(s)", "enumerate", "s", "if i % 2 == 0:\n if c == 'p':\n cnt -= 1\n else:\n if c == 'g':\n cnt += 1", "i % 2 == 0", "i % 2", "i", "2", "0", "if c == 'p':\n cnt -= 1\n ", "c == 'p'", "c", "'p'", "cnt -= 1", "cnt", "1", "if c == 'g':\n cnt += 1", "c == 'g'", "c", "'g'", "cnt += 1", "cnt", "1", "print(cnt)", "print", "cnt", "s = input()", "input()", "s", "cnt -= 1", "1", "cnt", "cnt += 1", "1", "cnt", "cnt = 0", "0", "cnt" ]
s = input() cnt = 0 for i, c in enumerate(s): if i % 2 == 0: if c == 'p': cnt -= 1 else: if c == 'g': cnt += 1 print(cnt)
[ 7, 0, 13, 4, 13, 0, 13, 4, 13, 13, 0, 13, 17, 28, 13, 13, 4, 13, 18, 13, 39, 17, 17, 18, 13, 39, 17, 17, 14, 2, 13, 17, 0, 13, 17, 14, 2, 13, 17, 0, 13, 17, 4, 13, 13, 10, 17, 13, 10, 17, 13, 10, 4, 13, 10, 4, 13, 10, 17, 13 ]
[ [ 52, 2 ], [ 55, 6 ], [ 53, 9 ], [ 49, 11 ], [ 53, 19 ], [ 53, 24 ], [ 46, 33 ], [ 58, 40 ], [ 59, 44 ], [ 47, 44 ], [ 50, 44 ], [ 46, 47 ], [ 49, 50 ], [ 52, 53 ], [ 55, 56 ], [ 58, 59 ] ]
[ "s = input()\n\nl = len(s)\n\npoint = 0\nfor a, b in zip(s[0::2], s[1::2]):\n if a == 'p':\n point -= 1\n if b == 'g':\n point += 1\nprint(point)", "s = input()", "s", "input()", "input", "l = len(s)", "l", "len(s)", "len", "s", "point = 0", "point", "0", "for a, b in zip(s[0::2], s[1::2]):\n if a == 'p':\n point -= 1\n if b == 'g':\n point += 1", "a", "b", "zip(s[0::2], s[1::2])", "zip", "s[0::2]", "s", "0::2", "0", "2", "s[1::2]", "s", "1::2", "1", "2", "if a == 'p':\n point -= 1\n ", "a == 'p'", "a", "'p'", "point -= 1", "point", "1", "if b == 'g':\n point += 1", "b == 'g'", "b", "'g'", "point += 1", "point", "1", "print(point)", "print", "point", "point -= 1", "1", "point", "point = 0", "0", "point", "s = input()", "input()", "s", "l = len(s)", "len(s)", "l", "point += 1", "1", "point" ]
s = input() l = len(s) point = 0 for a, b in zip(s[0::2], s[1::2]): if a == 'p': point -= 1 if b == 'g': point += 1 print(point)
[ 7, 0, 13, 4, 13, 0, 13, 17, 0, 13, 17, 0, 13, 17, 13, 17, 28, 13, 13, 14, 2, 13, 17, 14, 2, 13, 13, 0, 13, 17, 0, 13, 17, 0, 13, 17, 14, 2, 13, 13, 0, 13, 17, 0, 13, 17, 0, 13, 17, 4, 13, 2, 13, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13, 10, 17, 13 ]
[ [ 79, 2 ], [ 67, 6 ], [ 58, 9 ], [ 64, 12 ], [ 82, 14 ], [ 18, 17 ], [ 80, 17 ], [ 17, 21 ], [ 68, 25 ], [ 77, 25 ], [ 71, 25 ], [ 59, 26 ], [ 86, 26 ], [ 74, 26 ], [ 70, 28 ], [ 55, 31 ], [ 73, 34 ], [ 68, 38 ], [ 77, 38 ], [ 71, 38 ], [ 59, 39 ], [ 86, 39 ], [ 74, 39 ], [ 76, 41 ], [ 85, 44 ], [ 61, 47 ], [ 56, 52 ], [ 65, 52 ], [ 62, 53 ], [ 83, 53 ], [ 55, 56 ], [ 58, 59 ], [ 61, 62 ], [ 64, 65 ], [ 67, 68 ], [ 70, 71 ], [ 73, 74 ], [ 76, 77 ], [ 79, 80 ], [ 82, 83 ], [ 85, 86 ] ]
[ "S = input()\np_count = 0\ng_count = 0\nwin, lose = 0, 0\nfor s in S:\n if s == \"g\":\n if p_count < g_count:\n p_count += 1\n win += 1\n else:\n g_count += 1\n else:\n if p_count < g_count:\n p_count += 1\n else:\n g_count += 1\n lose += 1\nprint(win - lose)", "S = input()", "S", "input()", "input", "p_count = 0", "p_count", "0", "g_count = 0", "g_count", "0", "win, lose = 0, 0", "win", "0", "lose", "0", "for s in S:\n if s == \"g\":\n if p_count < g_count:\n p_count += 1\n win += 1\n else:\n g_count += 1\n else:\n if p_count < g_count:\n p_count += 1\n else:\n g_count += 1\n lose += 1", "s", "S", "if s == \"g\":\n if p_count < g_count:\n p_count += 1\n win += 1\n else:\n g_count += 1\n else:\n if p_count < g_count:\n p_count += 1\n else:\n g_count += 1\n lose += 1", "s == \"g\"", "s", "\"g\"", "if p_count < g_count:\n p_count += 1\n win += 1\n else:\n g_count += 1\n ", "p_count < g_count", "p_count", "g_count", "p_count += 1", "p_count", "1", "win += 1", "win", "1", "g_count += 1", "g_count", "1", "if p_count < g_count:\n p_count += 1\n else:\n g_count += 1\n lose += 1", "p_count < g_count", "p_count", "g_count", "p_count += 1", "p_count", "1", "g_count += 1", "g_count", "1", "lose += 1", "lose", "1", "print(win - lose)", "print", "win - lose", "win", "lose", "win += 1", "1", "win", "g_count = 0", "0", "g_count", "lose += 1", "1", "lose", "win, lose = 0, 0", "0", "win", "p_count = 0", "0", "p_count", "p_count += 1", "1", "p_count", "g_count += 1", "1", "g_count", "p_count += 1", "1", "p_count", "S = input()", "input()", "S", "lose = 0, 0", "0", "lose", "g_count += 1", "1", "g_count" ]
S = input() p_count = 0 g_count = 0 win, lose = 0, 0 for s in S: if s == "g": if p_count < g_count: p_count += 1 win += 1 else: g_count += 1 else: if p_count < g_count: p_count += 1 else: g_count += 1 lose += 1 print(win - lose)
[ 7, 12, 13, 0, 13, 4, 13, 0, 13, 17, 0, 13, 17, 28, 13, 13, 14, 2, 13, 17, 14, 13, 0, 13, 17, 0, 13, 17, 0, 13, 17, 14, 13, 0, 13, 17, 0, 13, 17, 0, 13, 17, 4, 13, 13, 14, 2, 13, 17, 4, 13, 10, 12, 13 ]
[ [ 5, 4 ], [ 9, 8 ], [ 12, 11 ], [ 15, 14 ], [ 4, 14 ], [ 14, 18 ], [ 24, 23 ], [ 27, 26 ], [ 30, 29 ], [ 35, 34 ], [ 38, 37 ], [ 41, 40 ], [ 37, 44 ], [ 23, 44 ], [ 8, 44 ], [ 53, 50 ] ]
[ "def main():\n s = input()\n ans = 0\n g_count = 0\n for c in s:\n if c == \"g\":\n if g_count:\n ans += 1\n g_count -= 1\n else:\n g_count += 1\n else:\n if g_count:\n g_count -= 1\n else:\n ans -= 1\n g_count += 1\n print(ans)\n\nif __name__ == \"__main__\":\n main()", "def main():\n s = input()\n ans = 0\n g_count = 0\n for c in s:\n if c == \"g\":\n if g_count:\n ans += 1\n g_count -= 1\n else:\n g_count += 1\n else:\n if g_count:\n g_count -= 1\n else:\n ans -= 1\n g_count += 1\n print(ans)", "main", "s = input()", "s", "input()", "input", "ans = 0", "ans", "0", "g_count = 0", "g_count", "0", "for c in s:\n if c == \"g\":\n if g_count:\n ans += 1\n g_count -= 1\n else:\n g_count += 1\n else:\n if g_count:\n g_count -= 1\n else:\n ans -= 1\n g_count += 1\n ", "c", "s", "if c == \"g\":\n if g_count:\n ans += 1\n g_count -= 1\n else:\n g_count += 1\n else:\n if g_count:\n g_count -= 1\n else:\n ans -= 1\n g_count += 1\n ", "c == \"g\"", "c", "\"g\"", "if g_count:\n ans += 1\n g_count -= 1\n else:\n g_count += 1\n ", "g_count", "ans += 1", "ans", "1", "g_count -= 1", "g_count", "1", "g_count += 1", "g_count", "1", "if g_count:\n g_count -= 1\n else:\n ans -= 1\n g_count += 1\n ", "g_count", "g_count -= 1", "g_count", "1", "ans -= 1", "ans", "1", "g_count += 1", "g_count", "1", "print(ans)", "print", "ans", "if __name__ == \"__main__\":\n main()", "__name__ == \"__main__\"", "__name__", "\"__main__\"", "main()", "main", "def main():\n s = input()\n ans = 0\n g_count = 0\n for c in s:\n if c == \"g\":\n if g_count:\n ans += 1\n g_count -= 1\n else:\n g_count += 1\n else:\n if g_count:\n g_count -= 1\n else:\n ans -= 1\n g_count += 1\n print(ans)", "def main():\n s = input()\n ans = 0\n g_count = 0\n for c in s:\n if c == \"g\":\n if g_count:\n ans += 1\n g_count -= 1\n else:\n g_count += 1\n else:\n if g_count:\n g_count -= 1\n else:\n ans -= 1\n g_count += 1\n print(ans)", "main" ]
def main(): s = input() ans = 0 g_count = 0 for c in s: if c == "g": if g_count: ans += 1 g_count -= 1 else: g_count += 1 else: if g_count: g_count -= 1 else: ans -= 1 g_count += 1 print(ans) if __name__ == "__main__": main()
[ 7, 0, 13, 4, 13, 0, 13, 4, 13, 17, 0, 13, 4, 13, 13, 4, 13, 2, 2, 13, 17, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13 ]
[ [ 26, 2 ], [ 23, 6 ], [ 29, 11 ], [ 27, 14 ], [ 30, 19 ], [ 24, 21 ], [ 23, 24 ], [ 26, 27 ], [ 29, 30 ] ]
[ "s = input()\np = sum(1 for i in s if i == 'p')\nl = len(s)\nprint(l // 2 - p)", "s = input()", "s", "input()", "input", "p = sum(1 for i in s if i == 'p')", "p", "sum(1 for i in s if i == 'p')", "sum", "1", "l = len(s)", "l", "len(s)", "len", "s", "print(l // 2 - p)", "print", "l // 2 - p", "l // 2", "l", "2", "p", "p = sum(1 for i in s if i == 'p')", "sum(1 for i in s if i == 'p')", "p", "s = input()", "input()", "s", "l = len(s)", "len(s)", "l" ]
s = input() p = sum(1 for i in s if i == 'p') l = len(s) print(l // 2 - p)
[ 7, 0, 13, 4, 13, 0, 13, 4, 13, 13, 15, 0, 13, 4, 13, 13, 0, 13, 4, 13, 13, 0, 13, 2, 13, 17, 4, 13, 4, 13, 2, 18, 13, 17, 13, 2, 13, 18, 13, 17, 10, 2, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13, 10, 4, 13 ]
[ [ 50, 2 ], [ 53, 6 ], [ 51, 9 ], [ 44, 12 ], [ 54, 15 ], [ 47, 17 ], [ 54, 20 ], [ 41, 22 ], [ 48, 24 ], [ 45, 32 ], [ 42, 34 ], [ 42, 36 ], [ 45, 38 ], [ 41, 42 ], [ 44, 45 ], [ 47, 48 ], [ 50, 51 ], [ 53, 54 ] ]
[ "s = input()\n\ns_list = list(s)\n\nfrom collections import Counter\n\ncounter = Counter(s_list)\n\ntimes = len(s_list)\n\nhalf = times // 2\nprint(min(counter[\"g\"] - half, half-counter[\"p\"]))\n", "s = input()", "s", "input()", "input", "s_list = list(s)", "s_list", "list(s)", "list", "s", "from collections import Counter", "counter = Counter(s_list)", "counter", "Counter(s_list)", "Counter", "s_list", "times = len(s_list)", "times", "len(s_list)", "len", "s_list", "half = times // 2", "half", "times // 2", "times", "2", "print(min(counter[\"g\"] - half, half-counter[\"p\"]))", "print", "min(counter[\"g\"] - half, half-counter[\"p\"])", "min", "counter[\"g\"] - half", "counter[\"g\"]", "counter", "\"g\"", "half", "half-counter[\"p\"]", "half", "counter[\"p\"]", "counter", "\"p\"", "half = times // 2", "times // 2", "half", "counter = Counter(s_list)", "Counter(s_list)", "counter", "times = len(s_list)", "len(s_list)", "times", "s = input()", "input()", "s", "s_list = list(s)", "list(s)", "s_list" ]
s = input() s_list = list(s) from collections import Counter counter = Counter(s_list) times = len(s_list) half = times // 2 print(min(counter["g"] - half, half-counter["p"]))
[ 7, 12, 13, 0, 13, 4, 13, 0, 13, 17, 0, 13, 17, 0, 13, 17, 0, 13, 17, 28, 13, 13, 14, 2, 13, 17, 14, 2, 13, 13, 0, 13, 17, 0, 13, 17, 0, 13, 17, 14, 2, 13, 13, 0, 13, 17, 0, 13, 17, 0, 13, 17, 4, 13, 2, 13, 13, 14, 2, 13, 17, 4, 13, 10, 12, 13 ]
[ [ 5, 4 ], [ 9, 8 ], [ 12, 11 ], [ 15, 14 ], [ 18, 17 ], [ 21, 20 ], [ 4, 20 ], [ 20, 24 ], [ 17, 28 ], [ 44, 28 ], [ 31, 28 ], [ 14, 29 ], [ 47, 29 ], [ 37, 29 ], [ 32, 31 ], [ 35, 34 ], [ 38, 37 ], [ 17, 41 ], [ 44, 41 ], [ 31, 41 ], [ 14, 42 ], [ 47, 42 ], [ 37, 42 ], [ 45, 44 ], [ 48, 47 ], [ 51, 50 ], [ 34, 55 ], [ 8, 55 ], [ 50, 56 ], [ 11, 56 ], [ 65, 62 ] ]
[ "def main():\n S = input()\n wi = 0\n lo = 0\n g = 0\n p = 0\n for s in S:\n if s == \"g\":\n if p < g:\n p += 1\n wi += 1\n else:\n g += 1\n else:\n if p < g:\n p += 1\n else:\n g += 1\n lo += 1\n print(wi - lo)\n\n\nif __name__ == '__main__':\n main()", "def main():\n S = input()\n wi = 0\n lo = 0\n g = 0\n p = 0\n for s in S:\n if s == \"g\":\n if p < g:\n p += 1\n wi += 1\n else:\n g += 1\n else:\n if p < g:\n p += 1\n else:\n g += 1\n lo += 1\n print(wi - lo)", "main", "S = input()", "S", "input()", "input", "wi = 0", "wi", "0", "lo = 0", "lo", "0", "g = 0", "g", "0", "p = 0", "p", "0", "for s in S:\n if s == \"g\":\n if p < g:\n p += 1\n wi += 1\n else:\n g += 1\n else:\n if p < g:\n p += 1\n else:\n g += 1\n lo += 1\n ", "s", "S", "if s == \"g\":\n if p < g:\n p += 1\n wi += 1\n else:\n g += 1\n else:\n if p < g:\n p += 1\n else:\n g += 1\n lo += 1\n ", "s == \"g\"", "s", "\"g\"", "if p < g:\n p += 1\n wi += 1\n else:\n g += 1\n ", "p < g", "p", "g", "p += 1", "p", "1", "wi += 1", "wi", "1", "g += 1", "g", "1", "if p < g:\n p += 1\n else:\n g += 1\n lo += 1\n ", "p < g", "p", "g", "p += 1", "p", "1", "g += 1", "g", "1", "lo += 1", "lo", "1", "print(wi - lo)", "print", "wi - lo", "wi", "lo", "if __name__ == '__main__':\n main()", "__name__ == '__main__'", "__name__", "'__main__'", "main()", "main", "def main():\n S = input()\n wi = 0\n lo = 0\n g = 0\n p = 0\n for s in S:\n if s == \"g\":\n if p < g:\n p += 1\n wi += 1\n else:\n g += 1\n else:\n if p < g:\n p += 1\n else:\n g += 1\n lo += 1\n print(wi - lo)", "def main():\n S = input()\n wi = 0\n lo = 0\n g = 0\n p = 0\n for s in S:\n if s == \"g\":\n if p < g:\n p += 1\n wi += 1\n else:\n g += 1\n else:\n if p < g:\n p += 1\n else:\n g += 1\n lo += 1\n print(wi - lo)", "main" ]
def main(): S = input() wi = 0 lo = 0 g = 0 p = 0 for s in S: if s == "g": if p < g: p += 1 wi += 1 else: g += 1 else: if p < g: p += 1 else: g += 1 lo += 1 print(wi - lo) if __name__ == '__main__': main()
[ 7, 0, 13, 4, 13, 0, 13, 17, 0, 13, 17, 0, 13, 17, 0, 13, 17, 28, 13, 4, 13, 4, 13, 13, 14, 2, 13, 17, 0, 13, 17, 14, 2, 18, 13, 13, 17, 0, 13, 17, 14, 2, 18, 13, 13, 17, 0, 13, 17, 0, 13, 17, 0, 13, 17, 4, 13, 2, 13, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13, 10, 17, 13 ]
[ [ 82, 2 ], [ 67, 6 ], [ 88, 9 ], [ 70, 12 ], [ 73, 15 ], [ 19, 18 ], [ 83, 23 ], [ 89, 26 ], [ 62, 26 ], [ 65, 26 ], [ 77, 26 ], [ 76, 29 ], [ 83, 34 ], [ 18, 35 ], [ 79, 38 ], [ 83, 43 ], [ 18, 44 ], [ 64, 47 ], [ 61, 50 ], [ 85, 53 ], [ 86, 58 ], [ 71, 58 ], [ 80, 59 ], [ 74, 59 ], [ 61, 62 ], [ 64, 65 ], [ 67, 68 ], [ 70, 71 ], [ 73, 74 ], [ 76, 77 ], [ 79, 80 ], [ 82, 83 ], [ 85, 86 ], [ 88, 89 ] ]
[ "s=input()\nans=0\nres=0\nw=0\nl=0\nfor i in range(len(s)):\n if res==0:\n res+=1\n if s[i]=='p':\n l+=1\n else:\n if s[i]=='p':\n res-=1\n else:\n res-=1\n w+=1\nprint(w-l)", "s=input()", "s", "input()", "input", "ans=0", "ans", "0", "res=0", "res", "0", "w=0", "w", "0", "l=0", "l", "0", "for i in range(len(s)):\n if res==0:\n res+=1\n if s[i]=='p':\n l+=1\n else:\n if s[i]=='p':\n res-=1\n else:\n res-=1\n w+=1", "i", "range(len(s))", "range", "len(s)", "len", "s", "if res==0:\n res+=1\n if s[i]=='p':\n l+=1\n else:\n if s[i]=='p':\n res-=1\n else:\n res-=1\n w+=1", "res==0", "res", "0", "res+=1", "res", "1", "if s[i]=='p':\n l+=1\n ", "s[i]=='p'", "s[i]", "s", "i", "'p'", "l+=1", "l", "1", "if s[i]=='p':\n res-=1\n else:\n res-=1\n w+=1", "s[i]=='p'", "s[i]", "s", "i", "'p'", "res-=1", "res", "1", "res-=1", "res", "1", "w+=1", "w", "1", "print(w-l)", "print", "w-l", "w", "l", "res-=1", "1", "res", "res-=1", "1", "res", "ans=0", "0", "ans", "w=0", "0", "w", "l=0", "0", "l", "res+=1", "1", "res", "l+=1", "1", "l", "s=input()", "input()", "s", "w+=1", "1", "w", "res=0", "0", "res" ]
s=input() ans=0 res=0 w=0 l=0 for i in range(len(s)): if res==0: res+=1 if s[i]=='p': l+=1 else: if s[i]=='p': res-=1 else: res-=1 w+=1 print(w-l)
[ 7, 0, 13, 4, 13, 0, 13, 4, 13, 13, 0, 13, 21, 22, 17, 17, 22, 17, 17, 0, 13, 17, 28, 13, 4, 13, 13, 14, 2, 18, 13, 13, 17, 14, 2, 18, 13, 17, 18, 13, 17, 0, 18, 13, 17, 17, 0, 13, 17, 0, 18, 13, 17, 17, 14, 2, 18, 13, 17, 18, 13, 17, 0, 18, 13, 17, 17, 0, 18, 13, 17, 17, 0, 13, 17, 4, 13, 13, 10, 17, 13, 10, 4, 13, 10, 4, 13, 10, 17, 13, 10, 17, 13, 10, 21, 13 ]
[ [ 82, 2 ], [ 85, 6 ], [ 83, 9 ], [ 94, 11 ], [ 88, 20 ], [ 24, 23 ], [ 86, 26 ], [ 83, 30 ], [ 23, 31 ], [ 95, 36 ], [ 95, 39 ], [ 45, 42 ], [ 95, 43 ], [ 79, 47 ], [ 53, 50 ], [ 95, 51 ], [ 95, 57 ], [ 95, 60 ], [ 66, 63 ], [ 95, 64 ], [ 71, 68 ], [ 95, 69 ], [ 91, 73 ], [ 92, 77 ], [ 80, 77 ], [ 89, 77 ], [ 79, 80 ], [ 82, 83 ], [ 85, 86 ], [ 88, 89 ], [ 91, 92 ], [ 94, 95 ] ]
[ "S = input()\nN = len(S)\n\nhand = {'g': 0, 'p': 0}\nans = 0\nfor i in range(N):\n if S[i] == 'g':\n if hand['g'] > hand['p']:\n hand['p'] += 1\n ans += 1\n else:\n hand['g'] += 1\n else:\n if hand['g'] > hand['p']:\n hand['p'] += 1\n else:\n hand['g'] += 1\n ans -= 1\n\nprint(ans)", "S = input()", "S", "input()", "input", "N = len(S)", "N", "len(S)", "len", "S", "hand = {'g': 0, 'p': 0}", "hand", "{'g': 0, 'p': 0}", "'g'", "'g'", "0", "'p'", "'p'", "0", "ans = 0", "ans", "0", "for i in range(N):\n if S[i] == 'g':\n if hand['g'] > hand['p']:\n hand['p'] += 1\n ans += 1\n else:\n hand['g'] += 1\n else:\n if hand['g'] > hand['p']:\n hand['p'] += 1\n else:\n hand['g'] += 1\n ans -= 1", "i", "range(N)", "range", "N", "if S[i] == 'g':\n if hand['g'] > hand['p']:\n hand['p'] += 1\n ans += 1\n else:\n hand['g'] += 1\n else:\n if hand['g'] > hand['p']:\n hand['p'] += 1\n else:\n hand['g'] += 1\n ans -= 1", "S[i] == 'g'", "S[i]", "S", "i", "'g'", "if hand['g'] > hand['p']:\n hand['p'] += 1\n ans += 1\n else:\n hand['g'] += 1\n ", "hand['g'] > hand['p']", "hand['g']", "hand", "'g'", "hand['p']", "hand", "'p'", "hand['p'] += 1", "hand['p']", "hand", "'p'", "1", "ans += 1", "ans", "1", "hand['g'] += 1", "hand['g']", "hand", "'g'", "1", "if hand['g'] > hand['p']:\n hand['p'] += 1\n else:\n hand['g'] += 1\n ans -= 1", "hand['g'] > hand['p']", "hand['g']", "hand", "'g'", "hand['p']", "hand", "'p'", "hand['p'] += 1", "hand['p']", "hand", "'p'", "1", "hand['g'] += 1", "hand['g']", "hand", "'g'", "1", "ans -= 1", "ans", "1", "print(ans)", "print", "ans", "ans += 1", "1", "ans", "S = input()", "input()", "S", "N = len(S)", "len(S)", "N", "ans = 0", "0", "ans", "ans -= 1", "1", "ans", "hand = {'g': 0, 'p': 0}", "{'g': 0, 'p': 0}", "hand" ]
S = input() N = len(S) hand = {'g': 0, 'p': 0} ans = 0 for i in range(N): if S[i] == 'g': if hand['g'] > hand['p']: hand['p'] += 1 ans += 1 else: hand['g'] += 1 else: if hand['g'] > hand['p']: hand['p'] += 1 else: hand['g'] += 1 ans -= 1 print(ans)
[ 7, 12, 13, 0, 13, 4, 13, 0, 13, 17, 0, 13, 17, 0, 13, 17, 28, 13, 13, 14, 2, 13, 17, 14, 2, 13, 13, 0, 13, 17, 0, 13, 17, 0, 13, 17, 14, 2, 13, 13, 0, 13, 17, 0, 13, 17, 0, 13, 17, 4, 13, 13, 14, 2, 13, 17, 4, 13, 10, 12, 13 ]
[ [ 5, 4 ], [ 9, 8 ], [ 12, 11 ], [ 15, 14 ], [ 18, 17 ], [ 4, 17 ], [ 17, 21 ], [ 11, 25 ], [ 41, 25 ], [ 31, 25 ], [ 8, 26 ], [ 47, 26 ], [ 34, 26 ], [ 29, 28 ], [ 32, 31 ], [ 35, 34 ], [ 11, 38 ], [ 41, 38 ], [ 31, 38 ], [ 8, 39 ], [ 47, 39 ], [ 34, 39 ], [ 42, 41 ], [ 45, 44 ], [ 48, 47 ], [ 44, 51 ], [ 28, 51 ], [ 14, 51 ], [ 60, 57 ] ]
[ "def main():\n S = input()\n gu = 0\n par = 0\n ans = 0\n for s in S:\n if s == 'g':\n if par < gu:\n ans += 1\n par += 1\n else:\n gu += 1\n else:\n if par < gu:\n par += 1\n else:\n ans -= 1\n gu += 1\n\n print(ans)\n\n\n\nif __name__ == \"__main__\":\n main()", "def main():\n S = input()\n gu = 0\n par = 0\n ans = 0\n for s in S:\n if s == 'g':\n if par < gu:\n ans += 1\n par += 1\n else:\n gu += 1\n else:\n if par < gu:\n par += 1\n else:\n ans -= 1\n gu += 1\n\n print(ans)", "main", "S = input()", "S", "input()", "input", "gu = 0", "gu", "0", "par = 0", "par", "0", "ans = 0", "ans", "0", "for s in S:\n if s == 'g':\n if par < gu:\n ans += 1\n par += 1\n else:\n gu += 1\n else:\n if par < gu:\n par += 1\n else:\n ans -= 1\n gu += 1\n\n ", "s", "S", "if s == 'g':\n if par < gu:\n ans += 1\n par += 1\n else:\n gu += 1\n else:\n if par < gu:\n par += 1\n else:\n ans -= 1\n gu += 1\n\n ", "s == 'g'", "s", "'g'", "if par < gu:\n ans += 1\n par += 1\n else:\n gu += 1\n ", "par < gu", "par", "gu", "ans += 1", "ans", "1", "par += 1", "par", "1", "gu += 1", "gu", "1", "if par < gu:\n par += 1\n else:\n ans -= 1\n gu += 1\n\n ", "par < gu", "par", "gu", "par += 1", "par", "1", "ans -= 1", "ans", "1", "gu += 1", "gu", "1", "print(ans)", "print", "ans", "if __name__ == \"__main__\":\n main()", "__name__ == \"__main__\"", "__name__", "\"__main__\"", "main()", "main", "def main():\n S = input()\n gu = 0\n par = 0\n ans = 0\n for s in S:\n if s == 'g':\n if par < gu:\n ans += 1\n par += 1\n else:\n gu += 1\n else:\n if par < gu:\n par += 1\n else:\n ans -= 1\n gu += 1\n\n print(ans)", "def main():\n S = input()\n gu = 0\n par = 0\n ans = 0\n for s in S:\n if s == 'g':\n if par < gu:\n ans += 1\n par += 1\n else:\n gu += 1\n else:\n if par < gu:\n par += 1\n else:\n ans -= 1\n gu += 1\n\n print(ans)", "main" ]
def main(): S = input() gu = 0 par = 0 ans = 0 for s in S: if s == 'g': if par < gu: ans += 1 par += 1 else: gu += 1 else: if par < gu: par += 1 else: ans -= 1 gu += 1 print(ans) if __name__ == "__main__": main()
[ 7, 0, 13, 4, 13, 0, 13, 2, 4, 13, 13, 17, 28, 13, 13, 14, 2, 13, 17, 4, 13, 13, 10, 2, 13, 10, 4, 13 ]
[ [ 26, 2 ], [ 23, 6 ], [ 27, 10 ], [ 14, 13 ], [ 27, 13 ], [ 13, 17 ], [ 24, 21 ], [ 23, 24 ], [ 26, 27 ] ]
[ "s = input()\nnump = len(s)//2\nfor i in s:\n if(i=='p'): nump-=1\nprint(nump)", "s = input()", "s", "input()", "input", "nump = len(s)//2", "nump", "len(s)//2", "len(s)", "len", "s", "2", "for i in s:\n if(i=='p'): nump-=1", "i", "s", "if(i=='p'): num", "i=='p'", "i", "'p'", "print(nump)", "print", "nump", "nump = len(s)//2", "len(s)//2", "nump", "s = input()", "input()", "s" ]
s = input() nump = len(s)//2 for i in s: if(i=='p'): nump-=1 print(nump)
[ 7, 0, 13, 4, 13, 4, 13, 0, 13, 17, 0, 13, 17, 0, 13, 17, 28, 13, 13, 14, 2, 2, 13, 17, 40, 2, 13, 17, 13, 0, 13, 17, 0, 13, 17, 14, 2, 2, 13, 17, 40, 2, 13, 17, 13, 0, 13, 17, 14, 2, 13, 17, 0, 13, 17, 0, 13, 17, 0, 13, 17, 4, 13, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13, 10, 17, 13 ]
[ [ 86, 2 ], [ 89, 8 ], [ 68, 11 ], [ 77, 14 ], [ 18, 17 ], [ 87, 17 ], [ 17, 22 ], [ 90, 26 ], [ 66, 26 ], [ 84, 26 ], [ 78, 28 ], [ 75, 28 ], [ 81, 28 ], [ 71, 30 ], [ 83, 33 ], [ 17, 38 ], [ 90, 42 ], [ 66, 42 ], [ 84, 42 ], [ 78, 44 ], [ 75, 44 ], [ 81, 44 ], [ 65, 46 ], [ 17, 50 ], [ 80, 53 ], [ 74, 56 ], [ 92, 59 ], [ 93, 63 ], [ 72, 63 ], [ 69, 63 ], [ 65, 66 ], [ 68, 69 ], [ 71, 72 ], [ 74, 75 ], [ 77, 78 ], [ 80, 81 ], [ 83, 84 ], [ 86, 87 ], [ 89, 90 ], [ 92, 93 ] ]
[ "A= list(input())\np_c = 0\ntotal = 0 \ng_c = 0\nfor i in A:\n if i == \"g\" and p_c+1 <= g_c:\n total += 1\n p_c += 1\n elif i == \"p\" and p_c+1 <= g_c:\n p_c += 1\n elif i == \"g\":\n g_c += 1\n else:\n g_c += 1\n total -= 1\nprint(total)", "A= list(input())", "A", "list(input())", "list", "input()", "input", "p_c = 0", "p_c", "0", "total = 0", "total", "0", "g_c = 0", "g_c", "0", "for i in A:\n if i == \"g\" and p_c+1 <= g_c:\n total += 1\n p_c += 1\n elif i == \"p\" and p_c+1 <= g_c:\n p_c += 1\n elif i == \"g\":\n g_c += 1\n else:\n g_c += 1\n total -= 1", "i", "A", "if i == \"g\" and p_c+1 <= g_c:\n total += 1\n p_c += 1\n elif i == \"p\" and p_c+1 <= g_c:\n p_c += 1\n elif i == \"g\":\n g_c += 1\n else:\n g_c += 1\n total -= 1", "i == \"g\" and p_c+1 <= g_c", "i == \"g\"", "i", "\"g\"", "p_c+1 <= g_c", "p_c+1", "p_c", "1", "g_c", "total += 1", "total", "1", "p_c += 1", "p_c", "1", "elif i == \"p\" and p_c+1 <= g_c:\n p_c += 1\n ", "i == \"p\" and p_c+1 <= g_c", "i == \"p\"", "i", "\"p\"", "p_c+1 <= g_c", "p_c+1", "p_c", "1", "g_c", "p_c += 1", "p_c", "1", "elif i == \"g\":\n g_c += 1\n ", "i == \"g\"", "i", "\"g\"", "g_c += 1", "g_c", "1", "g_c += 1", "g_c", "1", "total -= 1", "total", "1", "print(total)", "print", "total", "p_c += 1", "1", "p_c", "total = 0", "0", "total", "total += 1", "1", "total", "g_c += 1", "1", "g_c", "g_c = 0", "0", "g_c", "g_c += 1", "1", "g_c", "p_c += 1", "1", "p_c", "A= list(input())", "list(input())", "A", "p_c = 0", "0", "p_c", "total -= 1", "1", "total" ]
A= list(input()) p_c = 0 total = 0 g_c = 0 for i in A: if i == "g" and p_c+1 <= g_c: total += 1 p_c += 1 elif i == "p" and p_c+1 <= g_c: p_c += 1 elif i == "g": g_c += 1 else: g_c += 1 total -= 1 print(total)
[ 7, 15, 13, 15, 15, 13, 15, 13, 15, 13, 15, 15, 15, 12, 13, 29, 18, 4, 18, 18, 13, 13, 13, 39, 17, 0, 13, 2, 2, 17, 17, 17, 0, 13, 4, 13, 0, 13, 17, 28, 13, 4, 13, 4, 13, 13, 14, 2, 2, 13, 17, 17, 14, 2, 18, 13, 13, 17, 9, 0, 13, 17, 14, 2, 18, 13, 13, 17, 0, 13, 17, 9, 4, 13, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 12, 13, 10, 2, 13, 10, 4, 13 ]
[ [ 88, 26 ], [ 91, 33 ], [ 86, 35 ], [ 76, 37 ], [ 41, 40 ], [ 92, 45 ], [ 40, 49 ], [ 92, 55 ], [ 40, 56 ], [ 82, 60 ], [ 92, 65 ], [ 40, 66 ], [ 79, 69 ], [ 80, 74 ], [ 83, 74 ], [ 77, 74 ], [ 76, 77 ], [ 79, 80 ], [ 82, 83 ], [ 88, 89 ], [ 91, 92 ] ]
[ "import sys\nfrom collections import *\nimport heapq\nimport math\nimport bisect\nfrom itertools import permutations\nfrom itertools import accumulate\nfrom fractions import gcd\ndef input():\n return sys.stdin.readline()[:-1]\nmod=10**9+7\n\ns=input()\n# lst=[0,0]\nans=0\nfor i in range(len(s)):\n if i%2==0:\n if s[i]==\"g\":\n continue\n else:\n ans-=1\n else:\n if s[i]==\"g\":\n ans+=1\n else:\n continue\nprint(ans)", "import sys", "sys", "from collections import *", "import heapq", "heapq", "import math", "math", "import bisect", "bisect", "from itertools import permutations", "from itertools import accumulate", "from fractions import gcd", "def input():\n return sys.stdin.readline()[:-1]", "input", "return sys.stdin.readline()[:-1]", "sys.stdin.readline()[:-1]", "sys.stdin.readline()", "sys.stdin.readline", "sys.stdin", "sys", "stdin", "readline", ":-1", "-1", "mod=10**9+7", "mod", "10**9+7", "10**9", "10", "9", "7", "s=input()", "s", "input()", "input", "ans=0", "ans", "0", "for i in range(len(s)):\n if i%2==0:\n if s[i]==\"g\":\n continue\n else:\n ans-=1\n else:\n if s[i]==\"g\":\n ans+=1\n else:\n continue", "i", "range(len(s))", "range", "len(s)", "len", "s", "if i%2==0:\n if s[i]==\"g\":\n continue\n else:\n ans-=1\n else:\n if s[i]==\"g\":\n ans+=1\n else:\n continue", "i%2==0", "i%2", "i", "2", "0", "if s[i]==\"g\":\n continue\n else:\n ans-=1\n ", "s[i]==\"g\"", "s[i]", "s", "i", "\"g\"", "continue", "ans-=1", "ans", "1", "if s[i]==\"g\":\n ans+=1\n else:\n continue", "s[i]==\"g\"", "s[i]", "s", "i", "\"g\"", "ans+=1", "ans", "1", "continue", "print(ans)", "print", "ans", "ans=0", "0", "ans", "ans+=1", "1", "ans", "ans-=1", "1", "ans", "def input():\n return sys.stdin.readline()[:-1]", "def input():\n return sys.stdin.readline()[:-1]", "input", "mod=10**9+7", "10**9+7", "mod", "s=input()", "input()", "s" ]
import sys from collections import * import heapq import math import bisect from itertools import permutations from itertools import accumulate from fractions import gcd def input(): return sys.stdin.readline()[:-1] mod=10**9+7 s=input() # lst=[0,0] ans=0 for i in range(len(s)): if i%2==0: if s[i]=="g": continue else: ans-=1 else: if s[i]=="g": ans+=1 else: continue print(ans)
[ 7, 0, 13, 4, 13, 0, 13, 17, 28, 13, 4, 13, 4, 13, 13, 14, 2, 18, 13, 13, 17, 0, 13, 2, 13, 17, 4, 13, 2, 2, 4, 13, 13, 17, 2, 4, 13, 13, 13, 10, 2, 13, 10, 4, 13, 10, 17, 13 ]
[ [ 43, 2 ], [ 46, 6 ], [ 10, 9 ], [ 44, 14 ], [ 44, 18 ], [ 9, 19 ], [ 40, 22 ], [ 47, 24 ], [ 41, 24 ], [ 44, 32 ], [ 44, 37 ], [ 41, 38 ], [ 47, 38 ], [ 40, 41 ], [ 43, 44 ], [ 46, 47 ] ]
[ "s = input()\n\nc = 0\n\nfor i in range(len(s)):\n if s[i]=='g':\n c = c+1\n\nprint(len(s)//2-(len(s)-c))", "s = input()", "s", "input()", "input", "c = 0", "c", "0", "for i in range(len(s)):\n if s[i]=='g':\n c = c+1", "i", "range(len(s))", "range", "len(s)", "len", "s", "if s[i]=='g':\n c = c+1", "s[i]=='g'", "s[i]", "s", "i", "'g'", "c = c+1", "c", "c+1", "c", "1", "print(len(s)//2-(len(s)-c))", "print", "len(s)//2-(len(s)-c)", "len(s)//2", "len(s)", "len", "s", "2", "len(s)-c", "len(s)", "len", "s", "c", "c = c+1", "c+1", "c", "s = input()", "input()", "s", "c = 0", "0", "c" ]
s = input() c = 0 for i in range(len(s)): if s[i]=='g': c = c+1 print(len(s)//2-(len(s)-c))
[ 7, 0, 13, 4, 13, 4, 13, 4, 13, 2, 4, 18, 13, 13, 17, 2, 2, 4, 13, 13, 17, 2, 4, 13, 13, 17, 10, 4, 13 ]
[ [ 27, 2 ], [ 28, 12 ], [ 28, 19 ], [ 28, 24 ], [ 27, 28 ] ]
[ "S = str(input())\nprint(S.count(\"g\")-(len(S)//2+len(S) % 2))", "S = str(input())", "S", "str(input())", "str", "input()", "input", "print(S.count(\"g\")-(len(S)//2+len(S) % 2))", "print", "S.count(\"g\")-(len(S)//2+len(S) % 2)", "S.count(\"g\")", "S.count", "S", "count", "\"g\"", "len(S)//2+len(S) % 2", "len(S)//2", "len(S)", "len", "S", "2", "len(S) % 2", "len(S)", "len", "S", "2", "S = str(input())", "str(input())", "S" ]
S = str(input()) print(S.count("g")-(len(S)//2+len(S) % 2))
[ 7, 0, 13, 4, 13, 0, 13, 17, 0, 13, 17, 0, 13, 17, 28, 13, 13, 14, 2, 13, 17, 14, 2, 13, 13, 0, 13, 17, 0, 13, 17, 0, 13, 17, 14, 2, 13, 13, 0, 13, 17, 0, 13, 17, 0, 13, 17, 4, 13, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13 ]
[ [ 66, 2 ], [ 78, 6 ], [ 72, 9 ], [ 51, 12 ], [ 16, 15 ], [ 67, 15 ], [ 15, 19 ], [ 73, 23 ], [ 61, 23 ], [ 55, 23 ], [ 52, 24 ], [ 64, 24 ], [ 58, 24 ], [ 75, 26 ], [ 54, 29 ], [ 57, 32 ], [ 73, 36 ], [ 61, 36 ], [ 55, 36 ], [ 52, 37 ], [ 64, 37 ], [ 58, 37 ], [ 60, 39 ], [ 63, 42 ], [ 69, 45 ], [ 70, 49 ], [ 76, 49 ], [ 79, 49 ], [ 51, 52 ], [ 54, 55 ], [ 57, 58 ], [ 60, 61 ], [ 63, 64 ], [ 66, 67 ], [ 69, 70 ], [ 72, 73 ], [ 75, 76 ], [ 78, 79 ] ]
[ "s=input()\nans = 0\np_n = 0; g_n = 0\nfor s_i in s:\n if s_i == \"g\":\n if p_n < g_n:\n ans += 1\n p_n += 1\n else:\n g_n += 1\n else:\n if p_n < g_n:\n p_n += 1\n else:\n g_n += 1\n ans -= 1\nprint(ans)", "s=input()", "s", "input()", "input", "ans = 0", "ans", "0", "p_n = 0", "p_n", "0", "g_n = 0", "g_n", "0", "for s_i in s:\n if s_i == \"g\":\n if p_n < g_n:\n ans += 1\n p_n += 1\n else:\n g_n += 1\n else:\n if p_n < g_n:\n p_n += 1\n else:\n g_n += 1\n ans -= 1", "s_i", "s", "if s_i == \"g\":\n if p_n < g_n:\n ans += 1\n p_n += 1\n else:\n g_n += 1\n else:\n if p_n < g_n:\n p_n += 1\n else:\n g_n += 1\n ans -= 1", "s_i == \"g\"", "s_i", "\"g\"", "if p_n < g_n:\n ans += 1\n p_n += 1\n else:\n g_n += 1\n ", "p_n < g_n", "p_n", "g_n", "ans += 1", "ans", "1", "p_n += 1", "p_n", "1", "g_n += 1", "g_n", "1", "if p_n < g_n:\n p_n += 1\n else:\n g_n += 1\n ans -= 1", "p_n < g_n", "p_n", "g_n", "p_n += 1", "p_n", "1", "g_n += 1", "g_n", "1", "ans -= 1", "ans", "1", "print(ans)", "print", "ans", "g_n = 0", "0", "g_n", "p_n += 1", "1", "p_n", "g_n += 1", "1", "g_n", "p_n += 1", "1", "p_n", "g_n += 1", "1", "g_n", "s=input()", "input()", "s", "ans -= 1", "1", "ans", "p_n = 0", "0", "p_n", "ans += 1", "1", "ans", "ans = 0", "0", "ans" ]
s=input() ans = 0 p_n = 0; g_n = 0 for s_i in s: if s_i == "g": if p_n < g_n: ans += 1 p_n += 1 else: g_n += 1 else: if p_n < g_n: p_n += 1 else: g_n += 1 ans -= 1 print(ans)
[ 7, 0, 13, 4, 13, 0, 13, 17, 28, 13, 4, 13, 4, 13, 13, 14, 2, 2, 13, 17, 17, 14, 2, 18, 13, 13, 17, 0, 13, 17, 14, 2, 18, 13, 13, 17, 0, 13, 17, 4, 13, 13, 10, 4, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13 ]
[ [ 43, 2 ], [ 52, 6 ], [ 10, 9 ], [ 44, 14 ], [ 9, 18 ], [ 44, 24 ], [ 9, 25 ], [ 49, 28 ], [ 44, 33 ], [ 9, 34 ], [ 46, 37 ], [ 47, 41 ], [ 50, 41 ], [ 53, 41 ], [ 43, 44 ], [ 46, 47 ], [ 49, 50 ], [ 52, 53 ] ]
[ "N = input()\nans = 0\nfor i in range(len(N)):\n if i%2 == 0:\n if N[i] ==\"p\":\n ans += -1\n else:\n if N[i] ==\"g\":\n ans += 1\nprint(ans)", "N = input()", "N", "input()", "input", "ans = 0", "ans", "0", "for i in range(len(N)):\n if i%2 == 0:\n if N[i] ==\"p\":\n ans += -1\n else:\n if N[i] ==\"g\":\n ans += 1", "i", "range(len(N))", "range", "len(N)", "len", "N", "if i%2 == 0:\n if N[i] ==\"p\":\n ans += -1\n else:\n if N[i] ==\"g\":\n ans += 1", "i%2 == 0", "i%2", "i", "2", "0", "if N[i] ==\"p\":\n ans += -1\n ", "N[i] ==\"p\"", "N[i]", "N", "i", "\"p\"", "ans += -1", "ans", "-1", "if N[i] ==\"g\":\n ans += 1", "N[i] ==\"g\"", "N[i]", "N", "i", "\"g\"", "ans += 1", "ans", "1", "print(ans)", "print", "ans", "N = input()", "input()", "N", "ans += 1", "1", "ans", "ans += -1", "-1", "ans", "ans = 0", "0", "ans" ]
N = input() ans = 0 for i in range(len(N)): if i%2 == 0: if N[i] =="p": ans += -1 else: if N[i] =="g": ans += 1 print(ans)
[ 7, 0, 13, 4, 13, 0, 13, 4, 13, 13, 0, 13, 17, 28, 13, 4, 13, 13, 14, 2, 2, 2, 13, 17, 17, 2, 18, 13, 13, 17, 0, 13, 17, 14, 2, 2, 2, 13, 17, 17, 2, 18, 13, 13, 17, 0, 13, 17, 4, 13, 13, 10, 17, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13, 10, 4, 13 ]
[ [ 58, 2 ], [ 64, 6 ], [ 59, 9 ], [ 52, 11 ], [ 15, 14 ], [ 65, 17 ], [ 14, 22 ], [ 59, 27 ], [ 14, 28 ], [ 55, 31 ], [ 14, 37 ], [ 59, 42 ], [ 14, 43 ], [ 61, 46 ], [ 62, 50 ], [ 56, 50 ], [ 53, 50 ], [ 52, 53 ], [ 55, 56 ], [ 58, 59 ], [ 61, 62 ], [ 64, 65 ] ]
[ "s = input()\nN = len(s)\ncnt = 0\nfor i in range(N):\n if i % 2 == 0 and s[i] == 'p':\n cnt -= 1\n elif i % 2 == 1 and s[i] == 'g':\n cnt += 1\nprint(cnt)", "s = input()", "s", "input()", "input", "N = len(s)", "N", "len(s)", "len", "s", "cnt = 0", "cnt", "0", "for i in range(N):\n if i % 2 == 0 and s[i] == 'p':\n cnt -= 1\n elif i % 2 == 1 and s[i] == 'g':\n cnt += 1", "i", "range(N)", "range", "N", "if i % 2 == 0 and s[i] == 'p':\n cnt -= 1\n elif i % 2 == 1 and s[i] == 'g':\n cnt += 1", "i % 2 == 0 and s[i] == 'p'", "i % 2 == 0", "i % 2", "i", "2", "0", "s[i] == 'p'", "s[i]", "s", "i", "'p'", "cnt -= 1", "cnt", "1", "elif i % 2 == 1 and s[i] == 'g':\n cnt += 1", "i % 2 == 1 and s[i] == 'g'", "i % 2 == 1", "i % 2", "i", "2", "1", "s[i] == 'g'", "s[i]", "s", "i", "'g'", "cnt += 1", "cnt", "1", "print(cnt)", "print", "cnt", "cnt = 0", "0", "cnt", "cnt -= 1", "1", "cnt", "s = input()", "input()", "s", "cnt += 1", "1", "cnt", "N = len(s)", "len(s)", "N" ]
s = input() N = len(s) cnt = 0 for i in range(N): if i % 2 == 0 and s[i] == 'p': cnt -= 1 elif i % 2 == 1 and s[i] == 'g': cnt += 1 print(cnt)
[ 7, 12, 13, 0, 13, 4, 13, 4, 13, 0, 13, 17, 28, 13, 4, 13, 4, 13, 13, 14, 2, 18, 13, 13, 17, 0, 13, 17, 4, 13, 2, 2, 4, 13, 13, 17, 13, 14, 2, 13, 17, 4, 13, 10, 12, 13 ]
[ [ 5, 4 ], [ 11, 10 ], [ 14, 13 ], [ 4, 18 ], [ 4, 22 ], [ 13, 23 ], [ 27, 26 ], [ 4, 34 ], [ 26, 36 ], [ 10, 36 ], [ 45, 42 ] ]
[ "def main():\n s = str(input())\n p = 0\n for i in range(len(s)):\n if s[i] == 'p':\n p += 1\n print(len(s)//2-p)\n \nif __name__ == \"__main__\":\n main()", "def main():\n s = str(input())\n p = 0\n for i in range(len(s)):\n if s[i] == 'p':\n p += 1\n print(len(s)//2-p)\n ", "main", "s = str(input())", "s", "str(input())", "str", "input()", "input", "p = 0", "p", "0", "for i in range(len(s)):\n if s[i] == 'p':\n p += 1\n ", "i", "range(len(s))", "range", "len(s)", "len", "s", "if s[i] == 'p':\n p += 1\n ", "s[i] == 'p'", "s[i]", "s", "i", "'p'", "p += 1", "p", "1", "print(len(s)//2-p)", "print", "len(s)//2-p", "len(s)//2", "len(s)", "len", "s", "2", "p", "if __name__ == \"__main__\":\n main()", "__name__ == \"__main__\"", "__name__", "\"__main__\"", "main()", "main", "def main():\n s = str(input())\n p = 0\n for i in range(len(s)):\n if s[i] == 'p':\n p += 1\n print(len(s)//2-p)\n ", "def main():\n s = str(input())\n p = 0\n for i in range(len(s)):\n if s[i] == 'p':\n p += 1\n print(len(s)//2-p)\n ", "main" ]
def main(): s = str(input()) p = 0 for i in range(len(s)): if s[i] == 'p': p += 1 print(len(s)//2-p) if __name__ == "__main__": main()
[ 7, 15, 13, 0, 13, 18, 13, 13, 4, 18, 13, 13, 2, 17, 17, 0, 13, 12, 4, 13, 4, 13, 0, 13, 12, 4, 13, 4, 13, 13, 4, 18, 4, 18, 13, 13, 13, 0, 13, 12, 4, 13, 4, 18, 4, 18, 13, 13, 13, 0, 13, 12, 4, 18, 4, 18, 13, 13, 13, 0, 13, 4, 13, 4, 13, 2, 2, 4, 13, 13, 17, 4, 18, 13, 13, 17, 10, 18, 13, 10, 4, 13, 10, 12, 13, 10, 12, 13, 10, 12, 13, 10, 12, 13 ]
[ [ 77, 4 ], [ 89, 16 ], [ 92, 23 ], [ 78, 34 ], [ 83, 38 ], [ 78, 46 ], [ 86, 50 ], [ 78, 56 ], [ 80, 60 ], [ 87, 62 ], [ 81, 69 ], [ 81, 73 ], [ 77, 78 ], [ 80, 81 ], [ 83, 84 ], [ 86, 87 ], [ 89, 90 ], [ 92, 93 ] ]
[ "import sys\nstdin = sys.stdin\nsys.setrecursionlimit(10**6)\nni = lambda: int(ns())\nna = lambda: list(map(int, stdin.readline().split()))\nnn = lambda: list(stdin.readline().split())\nns = lambda: stdin.readline().rstrip()\n\ns = ns()\n\nprint((len(s)//2)-s.count('p'))", "import sys", "sys", "stdin = sys.stdin", "stdin", "sys.stdin", "sys", "stdin", "sys.setrecursionlimit(10**6)", "sys.setrecursionlimit", "sys", "setrecursionlimit", "10**6", "10", "6", "ni = lambda: int(ns())", "ni", "lambda: int(ns())", "int(ns())", "int", "ns()", "ns", "na = lambda: list(map(int, stdin.readline().split()))", "na", "lambda: list(map(int, stdin.readline().split()))", "list(map(int, stdin.readline().split()))", "list", "map(int, stdin.readline().split())", "map", "int", "stdin.readline().split()", "stdin.readline().split", "stdin.readline()", "stdin.readline", "stdin", "readline", "split", "nn = lambda: list(stdin.readline().split())", "nn", "lambda: list(stdin.readline().split())", "list(stdin.readline().split())", "list", "stdin.readline().split()", "stdin.readline().split", "stdin.readline()", "stdin.readline", "stdin", "readline", "split", "ns = lambda: stdin.readline().rstrip()", "ns", "lambda: stdin.readline().rstrip()", "stdin.readline().rstrip()", "stdin.readline().rstrip", "stdin.readline()", "stdin.readline", "stdin", "readline", "rstrip", "s = ns()", "s", "ns()", "ns", "print((len(s)//2)-s.count('p'))", "print", "(len(s)//2)-s.count('p')", "len(s)//2", "len(s)", "len", "s", "2", "s.count('p')", "s.count", "s", "count", "'p'", "stdin = sys.stdin", "sys.stdin", "stdin", "s = ns()", "ns()", "s", "nn = lambda: list(stdin.readline().split())", "lambda: list(stdin.readline().split())", "nn", "ns = lambda: stdin.readline().rstrip()", "lambda: stdin.readline().rstrip()", "ns", "ni = lambda: int(ns())", "lambda: int(ns())", "ni", "na = lambda: list(map(int, stdin.readline().split()))", "lambda: list(map(int, stdin.readline().split()))", "na" ]
import sys stdin = sys.stdin sys.setrecursionlimit(10**6) ni = lambda: int(ns()) na = lambda: list(map(int, stdin.readline().split())) nn = lambda: list(stdin.readline().split()) ns = lambda: stdin.readline().rstrip() s = ns() print((len(s)//2)-s.count('p'))
[ 7, 12, 13, 0, 13, 4, 18, 4, 13, 13, 0, 13, 2, 2, 4, 13, 13, 17, 4, 18, 13, 13, 17, 4, 13, 13, 14, 2, 13, 17, 4, 13, 10, 12, 13 ]
[ [ 5, 4 ], [ 12, 11 ], [ 4, 16 ], [ 4, 20 ], [ 11, 25 ], [ 34, 31 ] ]
[ "# ARC062D - AtCoDeerくんと変なじゃんけん / AtCoDeer and Rock-Paper (ABC046D)\ndef main():\n # p as much as possible (len(S) // 2)\n S = input().rstrip()\n ans = len(S) // 2 - S.count(\"p\")\n print(ans)\n\n\nif __name__ == \"__main__\":\n main()", "def main():\n # p as much as possible (len(S) // 2)\n S = input().rstrip()\n ans = len(S) // 2 - S.count(\"p\")\n print(ans)", "main", "S = input().rstrip()", "S", "input().rstrip()", "().rstrip", "()", "input", "rstrip", "ans = len(S) // 2 - S.count(\"p\")", "ans", "len(S) // 2 - S.count(\"p\")", "len(S) // 2", "len(S)", "len", "S", "2", "S.count(\"p\")", "S.count", "S", "count", "\"p\"", "print(ans)", "print", "ans", "if __name__ == \"__main__\":\n main()", "__name__ == \"__main__\"", "__name__", "\"__main__\"", "main()", "main", "def main():\n # p as much as possible (len(S) // 2)\n S = input().rstrip()\n ans = len(S) // 2 - S.count(\"p\")\n print(ans)", "def main():\n # p as much as possible (len(S) // 2)\n S = input().rstrip()\n ans = len(S) // 2 - S.count(\"p\")\n print(ans)", "main" ]
# ARC062D - AtCoDeerくんと変なじゃんけん / AtCoDeer and Rock-Paper (ABC046D) def main(): # p as much as possible (len(S) // 2) S = input().rstrip() ans = len(S) // 2 - S.count("p") print(ans) if __name__ == "__main__": main()
[ 7, 15, 13, 0, 13, 4, 13, 4, 13, 0, 13, 4, 18, 13, 13, 13, 0, 13, 18, 13, 17, 0, 13, 18, 13, 17, 0, 13, 2, 13, 13, 4, 13, 2, 13, 17, 10, 2, 13, 10, 4, 13, 10, 18, 13, 10, 4, 13, 10, 18, 13 ]
[ [ 46, 4 ], [ 40, 10 ], [ 47, 15 ], [ 43, 17 ], [ 41, 19 ], [ 49, 22 ], [ 41, 24 ], [ 37, 27 ], [ 44, 29 ], [ 50, 30 ], [ 38, 34 ], [ 37, 38 ], [ 40, 41 ], [ 43, 44 ], [ 46, 47 ], [ 49, 50 ] ]
[ "import collections\ns = list(input())\nc = collections.Counter(s)\nNg = c[\"g\"]\nNp = c[\"p\"]\nn = Ng-Np\nprint(n//2)", "import collections", "collections", "s = list(input())", "s", "list(input())", "list", "input()", "input", "c = collections.Counter(s)", "c", "collections.Counter(s)", "collections.Counter", "collections", "Counter", "s", "Ng = c[\"g\"]", "Ng", "c[\"g\"]", "c", "\"g\"", "Np = c[\"p\"]", "Np", "c[\"p\"]", "c", "\"p\"", "n = Ng-Np", "n", "Ng-Np", "Ng", "Np", "print(n//2)", "print", "n//2", "n", "2", "n = Ng-Np", "Ng-Np", "n", "c = collections.Counter(s)", "collections.Counter(s)", "c", "Ng = c[\"g\"]", "c[\"g\"]", "Ng", "s = list(input())", "list(input())", "s", "Np = c[\"p\"]", "c[\"p\"]", "Np" ]
import collections s = list(input()) c = collections.Counter(s) Ng = c["g"] Np = c["p"] n = Ng-Np print(n//2)
[ 7, 0, 13, 17, 13, 17, 13, 17, 13, 17, 28, 13, 4, 13, 14, 2, 13, 17, 14, 2, 13, 13, 0, 13, 17, 0, 13, 17, 0, 13, 17, 14, 2, 13, 13, 0, 13, 17, 0, 13, 17, 0, 13, 17, 4, 13, 2, 13, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13 ]
[ [ 50, 2 ], [ 56, 4 ], [ 77, 6 ], [ 71, 8 ], [ 12, 11 ], [ 11, 16 ], [ 51, 20 ], [ 60, 20 ], [ 54, 20 ], [ 57, 21 ], [ 75, 21 ], [ 66, 21 ], [ 65, 23 ], [ 68, 26 ], [ 53, 29 ], [ 51, 33 ], [ 60, 33 ], [ 54, 33 ], [ 57, 34 ], [ 75, 34 ], [ 66, 34 ], [ 74, 36 ], [ 59, 39 ], [ 62, 42 ], [ 69, 47 ], [ 78, 47 ], [ 63, 48 ], [ 72, 48 ], [ 50, 51 ], [ 53, 54 ], [ 56, 57 ], [ 59, 60 ], [ 62, 63 ], [ 65, 66 ], [ 68, 69 ], [ 71, 72 ], [ 74, 75 ], [ 77, 78 ] ]
[ "g,p,w,l=0,0,0,0\nfor s in input():\n if s==\"g\":\n if g>p:\n p+=1\n w+=1\n else:\n g+=1\n else:\n if g>p:\n p+=1\n else:\n g+=1\n l+=1\n\nprint(w-l)", "g,p,w,l=0,0,0,0", "g", "0", "p", "0", "w", "0", "l", "0", "for s in input():\n if s==\"g\":\n if g>p:\n p+=1\n w+=1\n else:\n g+=1\n else:\n if g>p:\n p+=1\n else:\n g+=1\n l+=1", "s", "input()", "input", "if s==\"g\":\n if g>p:\n p+=1\n w+=1\n else:\n g+=1\n else:\n if g>p:\n p+=1\n else:\n g+=1\n l+=1", "s==\"g\"", "s", "\"g\"", "if g>p:\n p+=1\n w+=1\n else:\n g+=1\n ", "g>p", "g", "p", "p+=1", "p", "1", "w+=1", "w", "1", "g+=1", "g", "1", "if g>p:\n p+=1\n else:\n g+=1\n l+=1", "g>p", "g", "p", "p+=1", "p", "1", "g+=1", "g", "1", "l+=1", "l", "1", "print(w-l)", "print", "w-l", "w", "l", "g,p,w,l=0,0,0,0", "0", "g", "g+=1", "1", "g", "p,w,l=0,0,0,0", "0", "p", "g+=1", "1", "g", "l+=1", "1", "l", "p+=1", "1", "p", "w+=1", "1", "w", "l=0,0,0,0", "0", "l", "p+=1", "1", "p", "w,l=0,0,0,0", "0", "w" ]
g,p,w,l=0,0,0,0 for s in input(): if s=="g": if g>p: p+=1 w+=1 else: g+=1 else: if g>p: p+=1 else: g+=1 l+=1 print(w-l)
[ 7, 0, 13, 4, 13, 4, 13, 2, 2, 4, 13, 13, 17, 4, 18, 13, 13, 17, 10, 4, 13 ]
[ [ 19, 2 ], [ 20, 11 ], [ 20, 15 ], [ 19, 20 ] ]
[ "s=input();print(len(s)//2-s.count(\"p\"))", "s=input()", "s", "input()", "input", "print(len(s)//2-s.count(\"p\"))", "print", "len(s)//2-s.count(\"p\")", "len(s)//2", "len(s)", "len", "s", "2", "s.count(\"p\")", "s.count", "s", "count", "\"p\"", "s=input()", "input()", "s" ]
s=input();print(len(s)//2-s.count("p"))
[ 7, 15, 13, 13, 13, 13, 13, 13, 13, 13, 12, 13, 4, 18, 13, 13, 2, 17, 17, 0, 13, 2, 17, 17, 0, 13, 2, 2, 17, 17, 17, 41, 28, 13, 4, 18, 4, 18, 18, 13, 13, 13, 13, 4, 4, 13, 13, 0, 13, 12, 13, 0, 13, 12, 4, 13, 4, 18, 18, 13, 13, 13, 0, 13, 4, 18, 4, 18, 18, 13, 13, 13, 13, 0, 13, 4, 13, 13, 0, 13, 17, 28, 13, 4, 13, 13, 14, 2, 2, 13, 17, 17, 14, 2, 18, 13, 13, 17, 14, 2, 18, 13, 13, 17, 4, 13, 13, 14, 2, 13, 17, 4, 13, 10, 12, 13 ]
[ [ 21, 20 ], [ 26, 25 ], [ 34, 33 ], [ 33, 46 ], [ 49, 48 ], [ 53, 52 ], [ 64, 63 ], [ 75, 74 ], [ 63, 77 ], [ 80, 79 ], [ 83, 82 ], [ 74, 85 ], [ 82, 89 ], [ 63, 95 ], [ 82, 96 ], [ 63, 101 ], [ 82, 102 ], [ 79, 106 ], [ 115, 112 ] ]
[ "import sys,queue,math,copy,itertools,bisect,collections,heapq\n\ndef main():\n sys.setrecursionlimit(10**7)\n INF = 10**5\n MOD = 10**9 + 7\n LI = lambda : [int(x) for x in sys.stdin.readline().split()]\n NI = lambda : int(sys.stdin.readline())\n\n s = sys.stdin.readline().rstrip()\n n = len(s)\n ans = 0\n for i in range(n):\n if i % 2 == 0:\n if s[i] == 'p': ans -= 1\n else:\n if s[i] == 'g': ans += 1\n print(ans)\n\nif __name__ == '__main__':\n main()", "import sys,queue,math,copy,itertools,bisect,collections,heapq", "sys", "queue", "math", "copy", "itertools", "bisect", "collections", "heapq", "def main():\n sys.setrecursionlimit(10**7)\n INF = 10**5\n MOD = 10**9 + 7\n LI = lambda : [int(x) for x in sys.stdin.readline().split()]\n NI = lambda : int(sys.stdin.readline())\n\n s = sys.stdin.readline().rstrip()\n n = len(s)\n ans = 0\n for i in range(n):\n if i % 2 == 0:\n if s[i] == 'p': ans -= 1\n else:\n if s[i] == 'g': ans += 1\n print(ans)", "main", "sys.setrecursionlimit(10**7)", "sys.setrecursionlimit", "sys", "setrecursionlimit", "10**7", "10", "7", "INF = 10**5", "INF", "10**5", "10", "5", "MOD = 10**9 + 7", "MOD", "10**9 + 7", "10**9", "10", "9", "7", "int(x) for x in sys.stdin.readline().split()", "for x in sys.stdin.readline().split()", "x", "sys.stdin.readline().split()", "sys.stdin.readline().split", "sys.stdin.readline()", "sys.stdin.readline", "sys.stdin", "sys", "stdin", "readline", "split", "for x in sys.stdin.readline().split()", "int(x)", "int", "x", "LI = lambda : [int(x) for x in sys.stdin.readline().split()]", "LI", "lambda : [int(x) for x in sys.stdin.readline().split()]", "[int(x) for x in sys.stdin.readline().split()]", "NI = lambda : int(sys.stdin.readline())", "NI", "lambda : int(sys.stdin.readline())", "int(sys.stdin.readline())", "int", "sys.stdin.readline()", "sys.stdin.readline", "sys.stdin", "sys", "stdin", "readline", "s = sys.stdin.readline().rstrip()", "s", "sys.stdin.readline().rstrip()", "sys.stdin.readline().rstrip", "sys.stdin.readline()", "sys.stdin.readline", "sys.stdin", "sys", "stdin", "readline", "rstrip", "n = len(s)", "n", "len(s)", "len", "s", "ans = 0", "ans", "0", "for i in range(n):\n if i % 2 == 0:\n if s[i] == 'p': ans -= 1\n else:\n if s[i] == 'g': ans += 1\n ", "i", "range(n)", "range", "n", "if i % 2 == 0:\n if s[i] == 'p': ans -= 1\n else:\n if s[i] == 'g': ans += 1\n ", "i % 2 == 0", "i % 2", "i", "2", "0", "if s[i] == 'p': ans -= 1\n ", "s[i] == 'p'", "s[i]", "s", "i", "'p'", "if s[i] == 'g': ans += 1\n ", "s[i] == 'g'", "s[i]", "s", "i", "'g'", "print(ans)", "print", "ans", "if __name__ == '__main__':\n main()", "__name__ == '__main__'", "__name__", "'__main__'", "main()", "main", "def main():\n sys.setrecursionlimit(10**7)\n INF = 10**5\n MOD = 10**9 + 7\n LI = lambda : [int(x) for x in sys.stdin.readline().split()]\n NI = lambda : int(sys.stdin.readline())\n\n s = sys.stdin.readline().rstrip()\n n = len(s)\n ans = 0\n for i in range(n):\n if i % 2 == 0:\n if s[i] == 'p': ans -= 1\n else:\n if s[i] == 'g': ans += 1\n print(ans)", "def main():\n sys.setrecursionlimit(10**7)\n INF = 10**5\n MOD = 10**9 + 7\n LI = lambda : [int(x) for x in sys.stdin.readline().split()]\n NI = lambda : int(sys.stdin.readline())\n\n s = sys.stdin.readline().rstrip()\n n = len(s)\n ans = 0\n for i in range(n):\n if i % 2 == 0:\n if s[i] == 'p': ans -= 1\n else:\n if s[i] == 'g': ans += 1\n print(ans)", "main" ]
import sys,queue,math,copy,itertools,bisect,collections,heapq def main(): sys.setrecursionlimit(10**7) INF = 10**5 MOD = 10**9 + 7 LI = lambda : [int(x) for x in sys.stdin.readline().split()] NI = lambda : int(sys.stdin.readline()) s = sys.stdin.readline().rstrip() n = len(s) ans = 0 for i in range(n): if i % 2 == 0: if s[i] == 'p': ans -= 1 else: if s[i] == 'g': ans += 1 print(ans) if __name__ == '__main__': main()
[ 7, 15, 13, 15, 13, 15, 13, 15, 13, 15, 13, 4, 18, 13, 13, 2, 17, 17, 0, 13, 2, 17, 17, 0, 13, 2, 2, 17, 17, 17, 0, 13, 12, 4, 13, 4, 18, 4, 18, 18, 13, 13, 13, 13, 0, 13, 12, 4, 13, 13, 4, 18, 4, 18, 4, 18, 18, 13, 13, 13, 13, 13, 0, 13, 12, 4, 13, 4, 13, 13, 4, 18, 4, 18, 4, 18, 18, 13, 13, 13, 13, 13, 0, 13, 12, 4, 13, 4, 13, 12, 2, 4, 13, 13, 17, 23, 4, 18, 4, 18, 4, 18, 18, 13, 13, 13, 13, 13, 12, 13, 0, 13, 4, 13, 4, 13, 0, 13, 17, 0, 13, 17, 0, 13, 17, 28, 13, 4, 13, 4, 13, 13, 14, 40, 2, 13, 17, 13, 0, 13, 17, 0, 13, 17, 0, 13, 17, 0, 13, 17, 14, 2, 13, 18, 13, 13, 9, 14, 2, 13, 17, 0, 13, 17, 0, 13, 17, 4, 13, 13, 14, 2, 13, 17, 4, 13, 10, 2, 13, 10, 12, 13, 10, 12, 13, 10, 2, 13, 10, 12, 13, 10, 12, 13, 10, 12, 13 ]
[ [ 186, 19 ], [ 177, 24 ], [ 180, 31 ], [ 192, 45 ], [ 183, 63 ], [ 189, 83 ], [ 112, 111 ], [ 118, 117 ], [ 121, 120 ], [ 124, 123 ], [ 127, 126 ], [ 111, 131 ], [ 120, 135 ], [ 142, 135 ], [ 117, 137 ], [ 148, 137 ], [ 140, 139 ], [ 143, 142 ], [ 146, 145 ], [ 149, 148 ], [ 145, 152 ], [ 139, 152 ], [ 111, 154 ], [ 126, 155 ], [ 145, 159 ], [ 139, 159 ], [ 163, 162 ], [ 166, 165 ], [ 165, 169 ], [ 162, 169 ], [ 123, 169 ], [ 196, 175 ], [ 177, 178 ], [ 180, 181 ], [ 183, 184 ], [ 186, 187 ], [ 189, 190 ], [ 192, 193 ] ]
[ "import sys\nimport math\nimport collections\nimport bisect\nimport itertools\n\n# import numpy as np\n\nsys.setrecursionlimit(10 ** 7)\nINF = 10 ** 20\nMOD = 10 ** 9 + 7\n# MOD = 998244353\n\nni = lambda: int(sys.stdin.readline().rstrip())\nns = lambda: map(int, sys.stdin.readline().rstrip().split())\nna = lambda: list(map(int, sys.stdin.readline().rstrip().split()))\nna1 = lambda: list(map(lambda x: int(x) - 1, sys.stdin.readline().rstrip().split()))\n\n\n# ===CODE===\n\ndef main():\n s = list(input())\n\n g = 0\n p = 0\n ans = 0\n\n for i in range(len(s)):\n if p + 1 <= g:\n a = \"p\"\n p += 1\n else:\n a = \"g\"\n g += 1\n\n if a == s[i]:\n continue\n elif a == \"p\":\n ans += 1\n else:\n ans -= 1\n\n print(ans)\n\n\nif __name__ == '__main__':\n main()", "import sys", "sys", "import math", "math", "import collections", "collections", "import bisect", "bisect", "import itertools", "itertools", "sys.setrecursionlimit(10 ** 7)", "sys.setrecursionlimit", "sys", "setrecursionlimit", "10 ** 7", "10", "7", "INF = 10 ** 20", "INF", "10 ** 20", "10", "20", "MOD = 10 ** 9 + 7", "MOD", "10 ** 9 + 7", "10 ** 9", "10", "9", "7", "ni = lambda: int(sys.stdin.readline().rstrip())", "ni", "lambda: int(sys.stdin.readline().rstrip())", "int(sys.stdin.readline().rstrip())", "int", "sys.stdin.readline().rstrip()", "sys.stdin.readline().rstrip", "sys.stdin.readline()", "sys.stdin.readline", "sys.stdin", "sys", "stdin", "readline", "rstrip", "ns = lambda: map(int, sys.stdin.readline().rstrip().split())", "ns", "lambda: map(int, sys.stdin.readline().rstrip().split())", "map(int, sys.stdin.readline().rstrip().split())", "map", "int", "sys.stdin.readline().rstrip().split()", "sys.stdin.readline().rstrip().split", "sys.stdin.readline().rstrip()", "sys.stdin.readline().rstrip", "sys.stdin.readline()", "sys.stdin.readline", "sys.stdin", "sys", "stdin", "readline", "rstrip", "split", "na = lambda: list(map(int, sys.stdin.readline().rstrip().split()))", "na", "lambda: list(map(int, sys.stdin.readline().rstrip().split()))", "list(map(int, sys.stdin.readline().rstrip().split()))", "list", "map(int, sys.stdin.readline().rstrip().split())", "map", "int", "sys.stdin.readline().rstrip().split()", "sys.stdin.readline().rstrip().split", "sys.stdin.readline().rstrip()", "sys.stdin.readline().rstrip", "sys.stdin.readline()", "sys.stdin.readline", "sys.stdin", "sys", "stdin", "readline", "rstrip", "split", "na1 = lambda: list(map(lambda x: int(x) - 1, sys.stdin.readline().rstrip().split()))", "na1", "lambda: list(map(lambda x: int(x) - 1, sys.stdin.readline().rstrip().split()))", "list(map(lambda x: int(x) - 1, sys.stdin.readline().rstrip().split()))", "list", "map(lambda x: int(x) - 1, sys.stdin.readline().rstrip().split())", "map", "lambda x: int(x) - 1", "int(x) - 1", "int(x)", "int", "x", "1", "x", "sys.stdin.readline().rstrip().split()", "sys.stdin.readline().rstrip().split", "sys.stdin.readline().rstrip()", "sys.stdin.readline().rstrip", "sys.stdin.readline()", "sys.stdin.readline", "sys.stdin", "sys", "stdin", "readline", "rstrip", "split", "def main():\n s = list(input())\n\n g = 0\n p = 0\n ans = 0\n\n for i in range(len(s)):\n if p + 1 <= g:\n a = \"p\"\n p += 1\n else:\n a = \"g\"\n g += 1\n\n if a == s[i]:\n continue\n elif a == \"p\":\n ans += 1\n else:\n ans -= 1\n\n print(ans)", "main", "s = list(input())", "s", "list(input())", "list", "input()", "input", "g = 0", "g", "0", "p = 0", "p", "0", "ans = 0", "ans", "0", "for i in range(len(s)):\n if p + 1 <= g:\n a = \"p\"\n p += 1\n else:\n a = \"g\"\n g += 1\n\n if a == s[i]:\n continue\n elif a == \"p\":\n ans += 1\n else:\n ans -= 1\n\n ", "i", "range(len(s))", "range", "len(s)", "len", "s", "if p + 1 <= g:\n a = \"p\"\n p += 1\n else:\n a = \"g\"\n g += 1\n\n ", "p + 1 <= g", "p + 1", "p", "1", "g", "a = \"p\"", "a", "\"p\"", "p += 1", "p", "1", "a = \"g\"", "a", "\"g\"", "g += 1", "g", "1", "if a == s[i]:\n continue\n elif a == \"p\":\n ans += 1\n else:\n ans -= 1\n\n ", "a == s[i]", "a", "s[i]", "s", "i", "continue", "elif a == \"p\":\n ans += 1\n ", "a == \"p\"", "a", "\"p\"", "ans += 1", "ans", "1", "ans -= 1", "ans", "1", "print(ans)", "print", "ans", "if __name__ == '__main__':\n main()", "__name__ == '__main__'", "__name__", "'__main__'", "main()", "main", "MOD = 10 ** 9 + 7", "10 ** 9 + 7", "MOD", "ni = lambda: int(sys.stdin.readline().rstrip())", "lambda: int(sys.stdin.readline().rstrip())", "ni", "na = lambda: list(map(int, sys.stdin.readline().rstrip().split()))", "lambda: list(map(int, sys.stdin.readline().rstrip().split()))", "na", "INF = 10 ** 20", "10 ** 20", "INF", "na1 = lambda: list(map(lambda x: int(x) - 1, sys.stdin.readline().rstrip().split()))", "lambda: list(map(lambda x: int(x) - 1, sys.stdin.readline().rstrip().split()))", "na1", "ns = lambda: map(int, sys.stdin.readline().rstrip().split())", "lambda: map(int, sys.stdin.readline().rstrip().split())", "ns", "def main():\n s = list(input())\n\n g = 0\n p = 0\n ans = 0\n\n for i in range(len(s)):\n if p + 1 <= g:\n a = \"p\"\n p += 1\n else:\n a = \"g\"\n g += 1\n\n if a == s[i]:\n continue\n elif a == \"p\":\n ans += 1\n else:\n ans -= 1\n\n print(ans)", "def main():\n s = list(input())\n\n g = 0\n p = 0\n ans = 0\n\n for i in range(len(s)):\n if p + 1 <= g:\n a = \"p\"\n p += 1\n else:\n a = \"g\"\n g += 1\n\n if a == s[i]:\n continue\n elif a == \"p\":\n ans += 1\n else:\n ans -= 1\n\n print(ans)", "main" ]
import sys import math import collections import bisect import itertools # import numpy as np sys.setrecursionlimit(10 ** 7) INF = 10 ** 20 MOD = 10 ** 9 + 7 # MOD = 998244353 ni = lambda: int(sys.stdin.readline().rstrip()) ns = lambda: map(int, sys.stdin.readline().rstrip().split()) na = lambda: list(map(int, sys.stdin.readline().rstrip().split())) na1 = lambda: list(map(lambda x: int(x) - 1, sys.stdin.readline().rstrip().split())) # ===CODE=== def main(): s = list(input()) g = 0 p = 0 ans = 0 for i in range(len(s)): if p + 1 <= g: a = "p" p += 1 else: a = "g" g += 1 if a == s[i]: continue elif a == "p": ans += 1 else: ans -= 1 print(ans) if __name__ == '__main__': main()
[ 7, 0, 13, 4, 13, 0, 13, 17, 28, 13, 13, 4, 13, 13, 17, 14, 2, 13, 17, 14, 2, 13, 17, 0, 13, 17, 14, 2, 13, 17, 0, 13, 17, 4, 13, 13, 10, 4, 13, 10, 17, 13, 10, 17, 13, 10, 17, 13 ]
[ [ 37, 2 ], [ 40, 6 ], [ 38, 13 ], [ 46, 24 ], [ 43, 31 ], [ 44, 35 ], [ 47, 35 ], [ 41, 35 ], [ 37, 38 ], [ 40, 41 ], [ 43, 44 ], [ 46, 47 ] ]
[ "ss = input()\n\nans = 0\nfor i, s in enumerate(ss, 1):\n if i % 2: # グーを出す\n if s == 'p':\n ans -= 1\n else: # パーを出す\n if s == 'g':\n ans += 1\n\nprint(ans)", "ss = input()", "ss", "input()", "input", "ans = 0", "ans", "0", "for i, s in enumerate(ss, 1):\n if i % 2: # グーを出す\n if s == 'p':\n ans -= 1\n else: # パーを出す\n if s == 'g':\n ans += 1", "i", "s", "enumerate(ss, 1)", "enumerate", "ss", "1", "if i % 2: # グーを出す\n if s == 'p':\n ans -= 1\n else: # パーを出す\n if s == 'g':\n ans += 1", "i % 2", "i", "2", "if s == 'p':\n ans -= 1\n ", "s == 'p'", "s", "'p'", "ans -= 1", "ans", "1", "if s == 'g':\n ans += 1", "s == 'g'", "s", "'g'", "ans += 1", "ans", "1", "print(ans)", "print", "ans", "ss = input()", "input()", "ss", "ans = 0", "0", "ans", "ans += 1", "1", "ans", "ans -= 1", "1", "ans" ]
ss = input() ans = 0 for i, s in enumerate(ss, 1): if i % 2: # グーを出す if s == 'p': ans -= 1 else: # パーを出す if s == 'g': ans += 1 print(ans)
[ 7, 0, 13, 4, 13, 0, 13, 17, 0, 13, 17, 28, 13, 4, 13, 4, 13, 13, 14, 40, 18, 13, 13, 18, 13, 13, 0, 13, 17, 4, 13, 13, 10, 17, 13, 10, 4, 13, 10, 17, 13, 10, 17, 13 ]
[ [ 36, 2 ], [ 42, 6 ], [ 39, 9 ], [ 13, 12 ], [ 37, 17 ], [ 37, 21 ], [ 12, 22 ], [ 43, 24 ], [ 12, 25 ], [ 33, 27 ], [ 34, 31 ], [ 40, 31 ], [ 33, 34 ], [ 36, 37 ], [ 39, 40 ], [ 42, 43 ] ]
[ "s = input()\ntar = 'CODEFESTIVAL2016'\nres = 0\nfor i in range(len(s)):\n if s[i] != tar[i]:\n res +=1\nprint(res)", "s = input()", "s", "input()", "input", "tar = 'CODEFESTIVAL2016'", "tar", "'CODEFESTIVAL2016'", "res = 0", "res", "0", "for i in range(len(s)):\n if s[i] != tar[i]:\n res +=1", "i", "range(len(s))", "range", "len(s)", "len", "s", "if s[i] != tar[i]:\n res +=1", "s[i] != tar[i]", "s[i]", "s", "i", "tar[i]", "tar", "i", "res +=1", "res", "1", "print(res)", "print", "res", "res +=1", "1", "res", "s = input()", "input()", "s", "res = 0", "0", "res", "tar = 'CODEFESTIVAL2016'", "'CODEFESTIVAL2016'", "tar" ]
s = input() tar = 'CODEFESTIVAL2016' res = 0 for i in range(len(s)): if s[i] != tar[i]: res +=1 print(res)