Harryxun/stf_run huggingface dataset:
N = int(input())
S = list(input())
i = 0
count = 0
while i <= N-1:
    while S[i] == S[i+1]:
      i += 1
      if i == N-1:
        break
    count +=1
    i +=1
    if i == N-1:
      count += 1
      break
print(count)

### FIXED CODE ###

N = int(input())
S = list(input())
i = 0
count = 0
while i < N-1:
    while S[i] == S[i+1]:
      i += 1
      if i == N-1:
        break
    if i == N-1:
      break
    count +=1
    i +=1
count +=1
print(count)
k = int(input())
a, b = map(int, input().split())
 
if ((a // k) + 1) * k <= b or a % k = 0:
  print("OK")
else:
  print("NG")

### FIXED CODE ###

k = int(input())
a, b = map(int, input().split())
 
if ((a // k) + 1) * k <= b or a % k == 0:
  print("OK")
else:
  print("NG")
T = int(input())

def hakidasi(L):
  n = len(bin(max(L))) - 2
  k, end = 0, len(L)
  for i in range(n - 1, -1, -1):
    for j in range(k, end):
      if (L[j] >> i) & 1:
        L[k], L[j] = L[j], L[k]
        break
    else:
      continue
    k += 1
    for j in range(end):
      if j == k - 1: continue
      if (L[j] >> i) & 1:
        L[j] ^= L[k - 1]
  return L

def judge(L, x):
  n = len(bin(max(L))) - 2
  m = len(L)
  for i in range(m):
    a = len(bin(x))
    b = len(bin(L[i]))
    if a == b:
      x ^= L[i]
    elif a > b:
      return False
    if x == 0:
      return True
  return False

def main():
  N = int(input())
  A = list(map(int, input().split()))
  S = input()
  U = 60
  
  L = []
  for i in range(N - 1, -1, -1):
    n = int(S[i])
    if n == 0:
      L.append(A[i])
      L = hakidasi(L)
      if L[-1] == 0:
        L.pop()
    else:
      m = judge(L, A[i])
      if m == False:
        return 1
  return 0

for i in range(T):
  print(main())

### FIXED CODE ###

T = int(input())

def hakidasi(L):
  n = len(bin(max(L))) - 2
  k, end = 0, len(L)
  for i in range(n - 1, -1, -1):
    for j in range(k, end):
      if (L[j] >> i) & 1:
        L[k], L[j] = L[j], L[k]
        break
    else:
      continue
    k += 1
    for j in range(end):
      if j == k - 1: continue
      if (L[j] >> i) & 1:
        L[j] ^= L[k - 1]
  return L

def judge(L, x):
  if L == []:
    return False
  n = len(bin(max(L))) - 2
  m = len(L)
  for i in range(m):
    a = len(bin(x))
    b = len(bin(L[i]))
    if a == b:
      x ^= L[i]
    elif a > b:
      return False
    if x == 0:
      return True
  return False

def main():
  N = int(input())
  A = list(map(int, input().split()))
  S = input()
  U = 60
  
  L = []
  for i in range(N - 1, -1, -1):
    if A[i] == 0:
      continue
    n = int(S[i])
    if n == 0:
      L.append(A[i])
      L = hakidasi(L)
      if L[-1] == 0:
        L.pop()
    else:
      m = judge(L, A[i])
      if m == False:
        return 1
  return 0

for i in range(T):
  print(main())
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

H, W = MAP()
sw = [input() for _ in range(H)]

white = 0
for i in range(H):
	white += sw[i].count(".")
# print(white)

count = [[None]*W for _ in range(H)]
q = deque([])

dy = [1, 0, -1, 0]
dx = [0, -1, 0, 1]
def BFS():
	i, j = q.popleft()
	
	for x, y in zip(dx, dy):
		ny = i + y
		nx = j + x
		if 0 <= ny <= H-1 and 0 <= nx <= W-1 and sw[ny][nx] != '#' and count[ny][nx] == None:
			count[ny][nx] = count[i][j] + 1
			q.append((ny, nx))

	if len(q) != 0:
		BFS()


q.append((0, 0))
count[0][0] = 0

BFS()
# for i in count:
# 	print(i)
print(white-(count[H-1][W-1]+1))


### FIXED CODE ###

import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

H, W = MAP()
sw = [input() for _ in range(H)]

white = 0
for i in range(H):
	white += sw[i].count(".")
# print(white)

count = [[None]*W for _ in range(H)]
q = deque([])

dy = [1, 0, -1, 0]
dx = [0, -1, 0, 1]
def BFS():
	i, j = q.popleft()
	
	for x, y in zip(dx, dy):
		ny = i + y
		nx = j + x
		if 0 <= ny <= H-1 and 0 <= nx <= W-1 and sw[ny][nx] != '#' and count[ny][nx] == None:
			count[ny][nx] = count[i][j] + 1
			q.append((ny, nx))

	if len(q) != 0:
		BFS()


q.append((0, 0))
count[0][0] = 0

BFS()
# for i in count:
# 	print(i)
if count[H-1][W-1]:
	print(white-(count[H-1][W-1]+1))
else:
	print(-1)
s=input()
N=int(input())
l=len(s)
for scope in range(1,1+l):
  for first in range(1+l-scope):
    if not s[fist:first+scope] in li:
      li.append(s[first:first+scope])
    if len(li)==N:
      break
li.sort()   
print(li[N-1])

### FIXED CODE ###

str=input()
K=int(input())
s=set()
for scope in range(1,K+1):
    for f in range(len(str)-scope+1):
        s.add(str[f:f+scope])
print(sorted([x for x in s])[K-1])
input()
A = list(map(int, input().split()))
count = 0
while all(a % 2 == 0 for a in A):
    A = [a/2 for a in A]
    count += 1
print(count)

### FIXED CODE ###

print(input().count("1"))
a, b = map(int, input().split())

ab = str(a * int(b))
ba = str(b * int(a))

ans = [ab, ba].sort

print(ans[0])

### FIXED CODE ###

a, b = map(int, input().split())
 
ab = str(a) * int(b)
ba = str(b) * int(a)
 
ans = sorted([ab, ba])
print(ans[0])
import math

n = int(input())
for i in range(n):
    for i in range(2):
        x = int(input())
        y = int(input())
        result = x + y
        print(result) if math.log10(result) + 1 < 80 else print("overflow")

### FIXED CODE ###

n = int(input())
for i in range(n):
    x = int(input())
    y = int(input())
    if x + y >= 10 ** 80:
        print("overflow")
    else:
        print(x + y)
n = int(raw_input())
   
d = [ 0 for i in range(n) ]
f = [ 0 for i in range(n) ]
G = [ 0 for i in range(n) ]
v = [ [0 for i in range(n) ] for j in range(n) ]
st = [ 0 for i in range(n) ]
tm = [ 0 ]
   
def DFS_visit(s):
  st[ s ] = 1
  tm[ 0 ] += 1
  d[ s ] = tm[ 0 ]
  for e in range(n):
    if v[ s ][ e ] == 1 and st[ e ] == 0:
      DFS_visit(e)
  st[ s ] == 2
  tm[ 0 ] += 1
  f[ s ] = tm[ 0 ]
   
def DFS():
  for s in range(n):
    if st[ s ] == 0:
      DFS_visit(s)
  for s in range(n):
     print'{ 0 } { 1 } { 2 }'.format( s+1 , d[ s ] , f[ s ] )
       
for i in range(n):
  G = map( int , raw_input().split() )
  for j in range( G[ 1 ] ):
    v[ G[ 0 ] - 1 ][G [ 2+j ] - 1 ] = 1
   
DFS()

### FIXED CODE ###

n = int( raw_input() )
   
d = [ 0 for i in range(n) ]
f = [ 0 for i in range(n) ]
G = [ 0 for i in range(n) ]
v = [ [0 for i in range(n) ] for j in range(n) ]
st = [ 0 for i in range(n) ]
tm = [ 0 ]
   
def DFS_visit(s):
  st[ s ] = 1
  tm[ 0 ] += 1
  d[ s ] = tm[ 0 ]
  for e in range(n):
    if v[ s ][ e ] == 1 and st[ e ] == 0:
      DFS_visit(e)
  st[ s ] == 2
  tm[ 0 ] += 1
  f[ s ] = tm[ 0 ]
   
def DFS():
  for s in range(n):
    if st[ s ] == 0:
      DFS_visit(s)
  for s in range(n):
     print'{0} {1} {2}'.format( s+1 , d[ s ] , f[ s ] )
       
for i in range(n):
  G = map( int , raw_input().split() )
  for j in range( G[1] ):
    v[ G[0] -1 ][ G[ 2+j ] -1 ] = 1
   
DFS()
s = input()

cl = []
fl = []

for i, c_test in zip(range(len(s)), s):
    if c_test == 'C':
        cl.append(i)

for i, f_test in zip(range(len(s)), s):
    if f_test == 'F':
        fl.append(i)    
if max(fl) > min(cl):
    print("Yes")
else:
    print("No")

### FIXED CODE ###

s = input()

cl = []
fl = []

for i, c_test in zip(range(len(s)), s):
    if c_test == 'C':
        cl.append(i)

for i, f_test in zip(range(len(s)), s):
    if f_test == 'F':
        fl.append(i)
if len(cl) == 0 or len(fl) == 0:
    print("No")    
elif max(fl) > min(cl):
    print("Yes")
else:
    print("No")
import fractions

N = int(input())
A = [int(n) for n in input().split()]

def lcm(x, y):
  return x * y // fractions.gcd(x, y)

l = 1
for a in A:
  l = lcm(a, l)
B = [(l - 1) % a for a in A]
print(sum(B))

### FIXED CODE ###

a = sorted([int(n) for n in input().split()])
print(a[2] - a[0])
N = input();
l = list(int(input().split))
l.sort()
sum = 0
for i in range(N-1):
    sum += l[i]
    
if sum >= l[N-1]:
    print('No')
else:
    print('Yes')





### FIXED CODE ###

N = input()
N = int(N)
l = list(map(int,input().split()))
l.sort()
sum = 0
for i in range(N-1):
    sum += l[i]
    
if sum > l[N-1]:
    print('Yes')
else:
    print('No')
S = int(input())

if S[0] == S[1] or S [0] == S[2] or S[0] == S[3] or S[1] == S[2] or S[1] == S[3] or S[2] == S[3]:
  print('Bad')
else:
  print('Good')


### FIXED CODE ###

s = input()

if s[0] != s[1] and s[1] != s[2] and s[2] != s[3]:
  print('Good')
else:
  print('Bad')
A,B,C,X,Y=(int(i) for i in input().split())
 
if A+B<2*C:
  print(A*X+B*Y)
  
elif min(X,Y)<=2*C:
  if X>Y:
    print((X-Y)*A+2*Y*C)
  else:
    print((Y-X)*B+2*X*C)
elif A<=B:
  if X>Y:
    print(2*C*Y+(X-Y)*A)
  else:
    orint(2*C*Y)
else:
  if X<Y:
    print(2*C*X+(Y-X)*B)
  else:
    print(2*C*X)
  
  for i in range(print(2*C*max(X,Y))
        

### FIXED CODE ###

N,X=(int(i) for i in input().split())
L=[int(input()) for i in range(N)]
L.sort()
a=sum(L)
print(N+(X-a)//L[0])
import sys
from pprint import pprint

from collections import Counter
from math import factorial

def nCr(n, r):
    return factorial(n) // factorial(r) // factorial(n - r)

N = int(sys.stdin.readline())
S = sys.stdin.readline().strip()
# print(len(S))

counter = Counter(S)
rgb_count = 0

max_width = len(S) // 2
for width in range(1, max_width+1):
    max_left = len(S) - 2 * width
    # print(width, max_left)
    for i in range(max_left):
        if len(set([S[i], S[i+width], S[i+2*width]])) == 3:
            rgb_count += 1


all_count = nCr(counter["R"], 1) * nCr(counter["G"], 1) * nCr(counter["B"], 1) 
# print(all_count, rgb_count)
print(all_count - rgb_count)

### FIXED CODE ###

import sys
from pprint import pprint

from collections import Counter
from math import factorial

def nCr(n, r):
    return factorial(n) // factorial(r) // factorial(n - r)

N = int(sys.stdin.readline())
S = sys.stdin.readline().strip()
# print(len(S))

counter = Counter(S)
if len(counter) != 3:
    print("0")
    sys.exit()
rgb_count = 0

max_width = len(S) // 2
for width in range(1, max_width+1):
    max_left = len(S) - 2 * width
    # print(width, max_left)
    for i in range(max_left):
        if len(set([S[i], S[i+width], S[i+2*width]])) == 3:
            rgb_count += 1


all_count = nCr(counter["R"], 1) * nCr(counter["G"], 1) * nCr(counter["B"], 1) 
# print(all_count, rgb_count)
print(all_count - rgb_count)
s=input()
if s.count("RRR")>0:
  print(3)
elif s.cout("RR")>0:
  print(2)
elif s.cout("R")>0:
  print(1)
else:
  print(0)

### FIXED CODE ###

s=input()
if s.count("RRR")>0:
  print(3)
elif s.count("RR")>0:
  print(2)
elif s.count("R")>0:
  print(1)
else:
  print(0)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
n,w = map(int,input().split())
v = [0] * (n+1)
w = [0] * (n+1)

for j in range(1, n+1):
    v[j], w[j] = map(int,input().split())

dp = [[0 for i in range(w+1)] for j in range(n+1)]

for j in range(1, n+1):
    for i in range(1, w+1):
        dp[j][i] = max(dp[j-1][i], dp[j-1][i-w[j]] + v[i])

print(max(dp))

### FIXED CODE ###

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
N,W = map(int,input().split())
v = [0] * (N+1)
w = [0] * (N+1)

for j in range(1, N+1):
    v[j], w[j] = map(int,input().split())

dp = [[0 for i in range(W+1)] for j in range(N+1)]

for j in range(1, N+1):
    for i in range(1, W+1):
        if w[j] <= i:
            dp[j][i] = max(dp[j-1][i], dp[j-1][i-w[j]] + v[j])
        else:
            dp[j][i] = dp[j-1][i]

print(dp[N][W])
import sys
def add_link(a, b):
    la = links[a]
    i, j = [(0, 1), (1, 0)][s[b] == 'B']
    if not la[i] and la[j]:
        able[a] = True
    la[i].add(b)

n, m = map(int, input().split())
s = input()
links = [[set(), set()] for _ in range(n)]
able = [False] * n
for line in sys.stdin.readlines():
    a, b = map(int, line.split())
    a -= 1
    b -= 1
    add_link(a, b)
    add_link(b, a)
flag = 1
tmp = set()
for i in range(n):
  if able[i]:
    tmp.add(i)
while flag ==1:
  flag = 0
  for i in tmp:
    if not able[i]:
      continue
    for k in range(2):
      for j in links[i][k].copy():
        if not able[j]:
          links[i][k].remove(j)
    if (links[i][0] == set() or links[i][1] == set()):
      flag =1
      tmp.remove(i)
      able[i] = False
if any(able):
  print("Yes")
else:
  print("No")

### FIXED CODE ###

import sys
sys.setrecursionlimit(1000000)
n, m = map(int, input().split())
s = input()
links = [[] for _ in range(2*n)]
visit = [0] * n *2
for line in sys.stdin.readlines():
    a, b = map(int, line.split())
    a -= 1
    b -= 1
    if s[a] == s[b]:
      links[a].append(b+n)
      links[b].append(a+n)
    else:
      links[a+n].append(b)
      links[b+n].append(a)
def dfs(v):
  visit[v] = 1
  for i in links[v]:
    if visit[i] == 1:
      print("Yes")
      exit()
    elif visit[i] == 0:
      dfs(i)
  visit[v] = -1
  
for i in range(n):
  if visit[i] == 0:
    dfs(i)
print("No")
#!/usr/bin/env python3
import sys


def solve(H: int, W: int, A: "List[List[int]]", B: "List[List[int]]"):
    from itertools import chain
    dp = [[set() for _ in range(W+1)] for _ in range(H+1)]
    dp[0][0].add(0)
    for h in range(H):
        for w in range(W):
            d = A[h][w] - B[h][w]
            for v in dp[h][w]:
                dp[h+1][w].add(v+d)
                dp[h+1][w].add(v-d)
                dp[h][w+1].add(v+d)                                            
                dp[h][w+1].add(v-d)
    return min(map(abs, chain(dp[H-1][W], dp[H][W-1])))

# 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()
    H = int(next(tokens))  # type: int
    W = int(next(tokens))  # type: int
    A = [[int(next(tokens)) for _ in range(W)] for _ in range(H)]  # type: "List[List[int]]"
    B = [[int(next(tokens)) for _ in range(W)] for _ in range(H)]  # type: "List[List[int]]"
    print(solve(H, W, A, B))

def test():
    import doctest
    doctest.testmod()

if __name__ == '__main__':
    #test()
    main()


### FIXED CODE ###

S = sorted(input())
T = sorted(input(), reverse=True)
print("Yes" if T > S else "No")
s=input()
a=[]
for i in s:
	if i == 'B':
      if x:
		a.pop()
	else:
		a.append(i)
print(''.join(a))

### FIXED CODE ###

abc = [int(x) for x in input().split()]
abc.sort()
print("YES" if abc == [5,5,7] else "NO")
N=int(input())
b=0

for i in range(0,N):
    S[i]=input()

b=collections.Counter(S)
print(len(S))

### FIXED CODE ###

from collections import Counter
N=int(input())
b=0
S=[]

for i in range(0,N):
    S.append(input())
b=Counter(S)
print(len(b))
n=int(input())
v=list(map(int,input().split))
c=list(map(int,input().split))
ans=0
for i in range(n):
    if v[i]-c[i]>0:
        ans+=v[i]-c[i]

print(ans)



### FIXED CODE ###

n=int(input())
v=list(map(int,input().split()))
c=list(map(int,input().split()))
ans=0
for i in range(n):
    if v[i]-c[i]>0:
        ans+=v[i]-c[i]

print(ans)
a,b,c,d = map(int, input().split())

s1=list(map(int, input().split()))
s2=list(map(int, input().split()))
s3=list(map(int, input().split()))

ans1 = sorted(i+j for i in s1 for j in s2)
ans2 = sorted(i+j for i in ans1 for j in s3)
res = sorted(ans2,reverse=True)
print(*res[:k+1], sep="\n")

### FIXED CODE ###

import sys
input = sys.stdin.readline
 
x, y, z, k = map(int, input().split())
a = sorted(int(i) for i in input().split())
b = sorted(int(i) for i in input().split())
c = sorted(int(i) for i in input().split())
 
#a.sort(reverse=True)
#b.sort(reverse=True)
#c.sort(reverse=True)
 
ab = sorted(i+j for i in a for j in b)[:-k-1:-1]
abc = sorted(i+j for i in ab for j in c)[:-k-1:-1]
 
print(*abc[:k], sep="\n")
n=int(inpjut())
print(1/count(n%2==1))

### FIXED CODE ###

N = int(input())
count = 0
 
for i in range(1,N+1):
    if i % 2 == 1:
        count += 1

print(count/N)
s = input()
print(s.rfind(z)-s.find(a)+1)

### FIXED CODE ###

s = input()
print(s.rfind("Z")-s.find("A")+1)
while True :
 s = raw.input()
 a, op, b = s.split()
 if op == ? : break
 print eval(s)


### FIXED CODE ###

while True:
  s = raw_input()
  a, op, b = s.split()
  if op == '?': break
  print eval(s)
n = int(input())
k = int(input())
s = input()
l = s.count('L')
r = s.count('R')
now = 0
for i in range(len(s)):
  if s[i] == 'R' and s[i+1] == 'L':
    res += 1
print(min(now + K, min(l, r)))

### FIXED CODE ###

n, k = map(int, input().split())
s = input()
grp = 0
now = ""
for c in s:
  if c != now:
    grp += 1
    now = c
hap = 0
for i in range(n):
  if (i>0 and s[i]=='L' and s[i-1]=='L') or (i<n-1 and s[i]=='R' and s[i+1]=='R'):
    hap += 1
p_2 = (grp - 1) // 2
p_1 = (grp + 1) % 2
print(hap + 2 * min(k, p_2) + int(k > p_2) * p_1)
N = int(input())

neighbors = [[] for _ in range(N + 1)]
for _ in range(N - 1):
    u, v, w = map(int, input().split())
    neighbors[u].append((v, w))
    neighbors[v].append((u, w))

ans = [None for _ in range(N + 1)]
ans[1] = 0
seen = set()


def dfs(v, color):
    seen.add(v)
    for next_v, distance in neighbors[v]:
        if next_v in seen:
            continue
        next_color = color if distance % 2 == 0 else abs(color - 1)
        ans[next_v] = next_color
        dfs(next_v, next_color)


dfs(1, 0)
for e in ans[1:]:
    print(e)


### FIXED CODE ###

import sys
sys.setrecursionlimit(200000)

N = int(input())

neighbors = [[] for _ in range(N + 1)]
for _ in range(N - 1):
    u, v, w = map(int, input().split())
    neighbors[u].append((v, w))
    neighbors[v].append((u, w))

ans = [None for _ in range(N)]


def dfs(v, p, c):
    ans[v - 1] = c
    for next_v, distance in neighbors[v]:
        if next_v == p:
            continue
        next_c = c if distance % 2 == 0 else 1 - c
        dfs(next_v, v, next_c)


dfs(1, -1, 0)
for e in ans:
    print(e)
L = map(int,input().split())
K = int(input())
max = max(L)
print(L-max + max* (2 ** k))


### FIXED CODE ###

L = [list(map(int,input().split()))]
K = int(input())
import copy

def peice_double(L):
    l = []
    for x in L:
        tmp = copy.copy(x)
        for i in range(3):
            tmp[i] = tmp[i] * 2
            l.append(copy.copy(tmp))
            tmp[i] = tmp[i] // 2
    return l
for i in range(K):
    L = peice_double(L)
ans = 0
for x in L:
    ans = max(ans, sum(x))
print(ans)
import sys
input = sys.stdin.readline

def main():
    N = int(input())
    X = input()
    XINT = int(X,2)
    ANS = [0]*N
    TEMP = [0]*N
    CHAIND = [0]*N


    cnt = count_ones_by_bitmask(XINT)
    
    if cnt == 0:
        for i in range(N):
            print(1)
            return
    
    bit = 1
    p = XINT % (cnt+1)
    m = XINT % (cnt-1)
    pmod = 1
    mmod = 1
    for i in range(N):
        if not (cnt ==1 and X[N-i-1]=='1'):
            ANS[i] = 1
            if (X[N-i-1] == '0'):
                TEMP[i] = (p + pmod) % (cnt+1)
            else:
                TEMP[i] = (m - mmod) % (cnt-1)
        pmod = (pmod*2) % (cnt+1)
        mmod = (mmod*2) % (cnt-1)


    CHA = list(set(TEMP))

    for i in range(len(CHA)):
        an = 0
        cha = CHA[i]
        cnt = count_ones_by_bitmask(CHA[i])
        while cnt>0:
            an += 1
            cha = cha%cnt
            cnt = count_ones_by_bitmask(cha)
        CHAIND[CHA[i]] = an

    for i in reversed(range(N)):
        print(ANS[i]+CHAIND[TEMP[i]])




def count_ones_by_bitmask(num):
    count = 0
    while num:
        count += num & 1
        num >>= 1
    return count

if __name__ == '__main__':
    main()


### FIXED CODE ###

def main():
    N = int(input())
    X = input()
    XINT = int(X,2)
    ANS = [0]*N
    TEMP = [0]*N
    CHAIND = [0]*N

    cnt = count_ones_by_bitmask(XINT)
    
    if cnt == 0:
        for i in range(N):
            print(1)
            return
    if cnt ==1:
        for i in  range(N):
            if X[i] == '1':
                print(0) #全てが0になる
            else:
                if i==N-1:
                    print((int(X[N-1])+1)%2+1) # 2の剰余の反転
                else:
                    print((int(X[N-1]))%2+1) # 2の剰余
        return

    p = XINT % (cnt+1)
    m = XINT % (cnt-1)
    pmod = 1
    mmod = 1
    for i in range(N):
        ANS[i] = 1
        if (X[N-i-1] == '0'):
            TEMP[i] = (p + pmod) % (cnt+1)
        else:
            TEMP[i] = (m - mmod) % (cnt-1)
        pmod = (pmod*2) % (cnt+1)
        mmod = (mmod*2) % (cnt-1)


    CHA = list(set(TEMP))

    for i in range(len(CHA)):
        an = 0
        cha = CHA[i]
        cnt = count_ones_by_bitmask(CHA[i])
        while cnt>0:
            an += 1
            cha = cha%cnt
            cnt = count_ones_by_bitmask(cha)
        CHAIND[CHA[i]] = an

    for i in reversed(range(N)):
        print(ANS[i]+CHAIND[TEMP[i]])


def count_ones_by_bitmask(num):
    count = 0
    while num:
        count += num & 1
        num >>= 1
    return count

if __name__ == '__main__':
    main()
a ,b= map(int,input().split())
ans ,x , y ,c= 0 ,int(math.sqrt(a * a)) ,int(math.sqrt(b * b)),0
if x == 0:
    x = 1
    c += 1
    if b < 0:
        c += 1 
elif y == 0:
    y = 1
    c += 1
if (a < 0 and b < 0) and (a > b):
    ans = abs(x - y)
    c += 2
elif (a < 0 and b > 0) or (a > 0 and b < 0):
    ans = abs(x - y)
    c += 1
else:
    ans = abs(x - y)
print(ans + c)

### FIXED CODE ###

import math
a ,b= map(int,input().split())
ans ,x , y ,c = 0 ,int(math.sqrt(a * a)) ,int(math.sqrt(b * b)),0
if x == 0:
    if b < a:
         c += 1 
elif y == 0:
    c += 1
    if a < b:
        c -= 1
if (a < 0 and b < 0) and (a > b):
    ans = abs(x - y)
    c += 2
elif (a < 0 and b > 0) or (a > 0 and b < 0):
    ans = abs(x - y)
    c += 1
else:
    ans = abs(x - y)
    if a > b and a > 0 and b > 0:
        c += 2
print(ans + c)
a,b=int.input(),split()
if a-b＊2>=0:
  print(a-b＊2)
else:
   print('0')
  


### FIXED CODE ###

a,b=map(int,input().split())
if a-b*2<=0:
  
  print(0)
else:
  print(a-b*2)