Harryxun/sft_time huggingface dataset:
### BUGGY CODE ###

txt = list(input())
a = txt.pop(0)
b = a
count = 1
while(len(txt) != 0):
  #print(temp)
  a = txt.pop(0)
  if a == b:
    if len(txt) >= 1:
      a += txt.pop(0)
      b = a
      count += 1
    else:
      b += a
  #print(a)
  else:
    b = a
    count += 1
print(count)

### FIXED CODE ###

txt = list(input())
a = txt[0]
count = 1
i = 1
while(i < len(txt)):
  #print(temp)
  if a != txt[i]:
    a = txt[i]
    i += 1
    count += 1
  else:
    if (len(txt)-i) >= 2:
      a = txt[i:i+1]
      i += 2
      count += 1
    else:
      break
print(count)
### BUGGY CODE ###

#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def main():
    N = int(input())
    A = list(map(int, input().split()))
    result = []

    for a in A:
        result.append(a)
        result = result[::-1]

    print(*result)


if __name__ == "__main__":
    main()


### FIXED CODE ###

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import collections


def main():
    N = int(input())
    A = list(map(int, input().split()))

    result = collections.deque()

    for i in range(N):
        if i % 2 == N % 2:
            result.append(A[i])
        else:
            result.appendleft(A[i])
    print(*result)


if __name__ == "__main__":
    main()
### BUGGY CODE ###

N,A = map(int,input().split())
x = list(map(int,input().split()))

temp = x + [A]

X = max(temp)

m = N * X

dp = [[[0]*(m+1) for k in range(N+1)] for j in range(N+1)]

dp[0][0][0] = 1

res = 0

for j in range(N+1):
    for k in range(N+1):
        for s in range(m+1):
            if (j >= 1) & (s < x[j-1]):
                dp[j][k][s] = dp[j-1][k][s]
            elif (j >= 1) & (k >= 1) & (s >= x[j-1]):
                dp[j][k][s] = dp[j-1][k][s] + dp[j-1][k-1][s-x[j-1]]

        if (k >= 1) & (j == N):
            res += dp[N][k][k*A]

print(res)


### FIXED CODE ###

N,A = map(int,input().split())
x = list(map(int,input().split()))

temp = x + [A]

X = max(temp)

m = N * X

dp = [[[0 for s in range(m+1)] for k in range(N+1)] for j in range(N+1)]

dp[0][0][0] = 1

res = 0

for j in range(N):
    for k in range(N):
        for s in range(m):
            if dp[j][k][s]:
                dp[j+1][k][s] += dp[j][k][s]
                dp[j+1][k+1][s+x[j]] += dp[j][k][s]

for k in range(1,N+1):
    res += dp[N][k][k*A]

print(res)
### BUGGY CODE ###

n = int(input())
s = input()

s = list(s)

count = 0

for i in range(0,len(s)):
    for j in range(i,len(s)):
        for k in range(j,len(s)):
            if(j-i != k-j) and (s[i] != s[j] and s[i] != s[k] and s[j] != s[k]):
                count += 1


print(count)


### FIXED CODE ###

n = int(input())
s = input()

s = list(s)

k = r = b = g = count = 0

for i in range(len(s)):
    for j in range(i+1,len(s)):
        k = 2*j-i
        if k < n and s[i] != s[j] and s[i] != s[k] and s[j] != s[k]:
            count += 1    

rbg = s.count("R")*s.count("B")*s.count("G")

print(rbg-count)
### BUGGY CODE ###

def main():
    n=int(input())
    s=[input() for _ in [0]*n]
    s=[i+i[:-1] for i in s]+[i+i[:-1] for i in s][:-1]
    ans=[[True]*n for _ in [0]*n]
    for i in range(1,2*n-1):
        for j in range(2*n-2):
            for k in range(1,min(i+1,n,2*n-1-j)):
                if s[i][j]!=s[i-k][j+k]:
                    for l in range(max(-1,i-k-n,j-n)+1,min(n-k+1,i-k,j)+1):
                        ans[i-k-l][j-l]=False
    print(sum([sum(a) for a in ans]))
main()

### FIXED CODE ###

def main():
    n=int(input())
    nn=2*n-1
    s=[input() for _ in [0]*n]
    s=[i+i[:-1] for i in s]+[i+i[:-1] for i in s][:-1]
    ans=[[0]*n for _ in [0]*n]
    for i in range(1,nn):
        m=min(i+1,n)
        for j in range(nn-1):
            for k in range(max(i-j-n,0)+1,min(m,nn-j,i-j+n)):
                ii=i-k
                if s[i][j]!=s[ii][j+k]:
                    l=min(n-k+1,ii,j)
                    width=l-max(-1,ii-n,j-n)
                    ans[ii-l][j-l]=max(ans[ii-l][j-l],width)
    for i in range(1,n):
        for j in range(1,n):
            ans[i][j]=max(ans[i][j],ans[i-1][j-1]-1)
    print(sum([sum([i==0 for i in a]) for a in ans]))
main()
### BUGGY CODE ###

import numpy as np
H,W=map(int,input().split())

A=[list(map(int,input().split())) for _ in range(H)]
B=[list(map(int,input().split())) for _ in range(H)]

#dp[i][j]=マス(i,j)における可能なポイントのリスト
dp=[[set() for _ in range(W)] for _ in range(H)]
dp[0][0].add(0)

for i in range(W+H-1):
  I,J=0,0
  if i < H:
    I=i
    J=0
  else:
    I=H-1
    J=i-H+1
  while I>=0 and J<W:
    sa = A[I][J] - B[I][J]
    for point in dp[I][J]:
      if I!=H-1:
        dp[I+1][J].add(point+sa)
        dp[I+1][J].add(point-sa)
      if J!=W-1:
        dp[I][J+1].add(point+sa)
        dp[I][J+1].add(point-sa)
    I-=1
    J+=1

ans=dp[H-1][W-1]
sa = A[H-1][W-1] - B[H-1][W-1]
res=float("inf")
for p in ans:
  res=min(res,abs(p+sa),abs(p-sa))
print(res)

### FIXED CODE ###

H,W=map(int,input().split())

A=[list(map(int,input().split())) for _ in range(H)]
B=[list(map(int,input().split())) for _ in range(H)]

#dp[i][j]=マス(i,j)における可能なポイントのリスト
dp=[[set() for _ in range(W)] for _ in range(H)]
dp[0][0].add(0)

for i in range(W+H-1):
  I,J=0,0
  if i < H:
    I=i
    J=0
  else:
    I=H-1
    J=i-H+1
  while I>=0 and J<W:
    sa = abs(A[I][J] - B[I][J])
    for point in dp[I][J]:
      if I!=H-1:
        dp[I+1][J].add(point+sa)
        dp[I+1][J].add(abs(point-sa))
      if J!=W-1:
        dp[I][J+1].add(point+sa)
        dp[I][J+1].add(abs(point-sa))
    I-=1
    J+=1

ans=dp[H-1][W-1]
sa = abs(A[H-1][W-1] - B[H-1][W-1])
res=float("inf")
for p in ans:
  res=min(res,abs(p+sa),abs(p-sa))
print(res)
### BUGGY CODE ###

num=int(input())
list=[]
for i in range(num):
  a=input()
  if a not in list:
    list.append(a)
print(len(list))

### FIXED CODE ###

num=int(input())
list=[]
for i in range(num):
  a=input()
  list.append(a)
b=set(list)
print(len(b))
### BUGGY CODE ###

S = input()
Q = int(input())
k = 1
for _ in range(Q):
    query = input()
    if query.startswith('1'):
        k *= -1
    elif query.startswith('2'):
        t, f, c = query.split()
        if f == '1':
            if k > 0:
                S = c + S
            else:
                S = S + c
        elif f == '2':
            if k > 0:
                S = S + c
            else:
                S = c + S
if k > 0:
    print(S)
else:
    print(S[::-1])


### FIXED CODE ###

from collections import deque
S = input()
Q = int(input())
k = 1
d = deque(S)
for _ in range(Q):
    query = input()
    if query.startswith('1'):
        k *= -1
    elif query.startswith('2'):
        t, f, c = query.split()
        if f == '1':
            if k > 0:
                d.appendleft(c)                
            else:
                d.append(c)
        elif f == '2':
            if k > 0:
                d.append(c)
            else:
                d.appendleft(c)
d = list(d)
if k > 0:
    print(''.join(d))
else:
    print(''.join(d[::-1]))
### BUGGY CODE ###

import itertools
import sys

N, N1 = tuple([int(x) for x in sys.stdin.readline().split()])
D, C = [], []

for _ in range(N1):
    D.append([int(x) for x in sys.stdin.readline().split()])
for _ in range(N):
    C.append([int(x) for x in sys.stdin.readline().split()])

color_count = [[0] * N1 for _ in range(3)]
for i in range(N):
    for j in range(N):
        color_count[(i + j) % 3][C[i][j] - 1] += 1

min_cost = 2**64
for colors in list(itertools.permutations(range(N1))):
    cost = 0
    for i in range(3):
        for j, c in enumerate(color_count[i]):
            cost += c * D[j][colors[i]]
    if cost < min_cost:
        min_cost = cost
print(min_cost)

### FIXED CODE ###

import itertools
import sys

N, N1 = tuple([int(x) for x in sys.stdin.readline().split()])
D, C = [], []

for _ in range(N1):
    D.append([int(x) for x in sys.stdin.readline().split()])
for _ in range(N):
    C.append([int(x) for x in sys.stdin.readline().split()])

color_count = [[0] * N1 for _ in range(3)]
for i in range(N):
    for j in range(N):
        color_count[(i + j) % 3][C[i][j] - 1] += 1

min_cost = 2**64
for c0 in range(N1):
    for c1 in range(N1):
        if c0 == c1:
            continue
        for c2 in range(N1):
            if c0 == c2 or c1 == c2:
                continue
            cost = 0
            for j in range(N1):
                cost += color_count[0][j] * D[j][c0]
                cost += color_count[1][j] * D[j][c1]
                cost += color_count[2][j] * D[j][c2]
            if cost < min_cost:
                min_cost = cost

print(min_cost)
### BUGGY CODE ###

def find(A,x) -> int:
    p = A[x]
    if p == x:
        return x
    a = find(A,p)
    A[x] = a
    return a

def union(A, x, y):
    if find(A,x) > find(A,y):
        bx, by = find(A,y), find(A,x)
    else:
        bx, by = find(A,x), find(A,y)
    A[y] = bx
    A[by] = bx

def examD():
    N = I()
    x = [[] for _ in range(N)]; y = [[] for _ in range(N)]
    for i in range(N):
        a, b = LI()
        x[i] = (a-1,i)
        y[i] = (b-1,i)
    v = [ i for i in range(N)]
    X = sorted(x,key=lambda x:x[0])
    Y = sorted(y,key=lambda x:x[0])
    H = []
    heapify(H)
    for i in range(N - 1):
        x1, j1 = X[i]
        x2, j2 = X[i + 1]
        y1, k1 = Y[i]
        y2, k2 = Y[i + 1]
        heappush(H, (x2 - x1, j1, j2))
        heappush(H, (y2 - y1, k1, k2))
    ans = 0
#    print(H)
#    print(v)
    while H:
        w, s, t = heappop(H)
        if find(v, s) != find(v, t):
            union(v, s, t)
            ans += w
    print(ans)

import sys
import copy
import bisect
from heapq import *
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examD()


### FIXED CODE ###

def find(A,x) -> int:
    p = A[x]
    if p == x:
        return x
    a = find(A,p)
    A[x] = a
    return a

def union(A, x, y):
    if find(A,x) > find(A,y):
        bx, by = find(A,y), find(A,x)
    else:
        bx, by = find(A,x), find(A,y)
    A[y] = bx
    A[by] = bx
def examD():
    N = I()
    x = [[] for _ in range(N)]; y = [[] for _ in range(N)]
    for i in range(N):
        a, b = LI()
        x[i] = (a-1,i)
        y[i] = (b-1,i)
    v = [ i for i in range(N)]
    x.sort(); y.sort()
    H = []
    heapify(H)
    for i in range(N - 1):
        x1, j1 = x[i]
        x2, j2 = x[i + 1]
        y1, k1 = y[i]
        y2, k2 = y[i + 1]
        heappush(H, (x2 - x1, j1, j2))
        heappush(H, (y2 - y1, k1, k2))
    ans = 0
#    print(H)
#    print(v)
    while H:
        w, s, t = heappop(H)
        if find(v, s) != find(v, t):
            union(v, s, t)
            ans += w
    print(ans)

import sys
import copy
import bisect
from heapq import *
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examD()
### BUGGY CODE ###

import sys
sys.setrecursionlimit(10**5)
a, b, c = map(int, input().split())

M = 100
memo = {}
def dfs(a, b, c):
    if (a, b, c) in memo:
        return memo[a,b,c]
    if a == b == c:
        return 0
    res = 10**9+7
    if a < M:
        res = min(res, dfs(a+2, b, c) + 1)
    if b < M:
        res = min(res, dfs(a, b+2, c) + 1)
    if c < M:
        res = min(res, dfs(a, b, c+2) + 1)
    if a < M and b < M:
        res = min(res, dfs(a+1, b+1, c) + 1)
    if b < M and c < M:
        res = min(res, dfs(a, b+1, c+1) + 1)
    if a < M and c < M:
        res = min(res, dfs(a+1, b, c+1) + 1)
    memo[a, b, c] = res
    return res
print(dfs(a, b, c))

### FIXED CODE ###

a, b, c= map(int, input().split())
ans = 0
def calc(a, b):
    if a < b:
        r = b-a
        if r % 2:
            return r//2 + 2
        return r//2
    else:
        return a-b
def solve(a, b, c):
    return calc(a, c) + calc(b, c)
print(min(solve(a, b, c), solve(b, c, a), solve(c, a, b)))
### BUGGY CODE ###

dhw = [(1,0),(0,-1),(0,1),(-1,0),
( 2,-2),( 2,-1),( 2, 0),( 2, 1),( 2, 2),
( 1,-2),( 1,-1),        ( 1, 1),( 1, 2),
( 0,-2),                        ( 0, 2),
(-1,-2),(-1,-1),        (-1, 1),(-1, 2),
(-2,-2),(-2,-1),(-2, 0),(-2, 1),(-2, 2)]

H, W = map(int, input().split())
sh, sw = map(lambda x:int(x)-1, input().split())
eh, ew = map(lambda x:int(x)-1, input().split())
S = [input() for _ in range(H)]

dst = [[-1]*W for _ in range(H)]

from collections import deque
dq = deque([(sh, sw, 0)])
while dq:
    h, w, d = dq.popleft()
    if dst[h][w] >= 0 or S[h][w] == '#': continue
    if dst[h][w] == -1 or d < dst[h][w]: dst[h][w] = d

    for i in range(4):
        nh = h + dhw[i][0]; nw = w + dhw[i][1]
        if nh < 0 or H <= nh : continue
        if nw < 0 or W <= nw : continue
        if S[nh][nw] == '#': continue
        if dst[nh][nw] >= 0: continue
        dq.appendleft((nh, nw, d))

    for i in range(4, 24):
        nh = h + dhw[i][0]; nw = w + dhw[i][1]
        if nh < 0 or H <= nh : continue
        if nw < 0 or W <= nw : continue
        if S[nh][nw] == '#': continue
        if dst[nh][nw] >= 0: continue
        dq.append((nh, nw, d+1))

print(dst[eh][ew])


### FIXED CODE ###

dhw = [(1,0),(0,-1),(0,1),(-1,0),
( 2,-2),( 2,-1),( 2, 0),( 2, 1),( 2, 2),
( 1,-2),( 1,-1),        ( 1, 1),( 1, 2),
( 0,-2),                        ( 0, 2),
(-1,-2),(-1,-1),        (-1, 1),(-1, 2),
(-2,-2),(-2,-1),(-2, 0),(-2, 1),(-2, 2)]

H, W = map(int, input().split())
sh, sw = map(lambda x:int(x)-1, input().split())
eh, ew = map(lambda x:int(x)-1, input().split())
S = [input() for _ in range(H)]

dst = [[-1]*W for _ in range(H)]

from collections import deque
dq = deque([(sh, sw, 0)])
while dq:
    h, w, d = dq.popleft()
    if 0 <= h < H and 0 <= w < W and dst[h][w] < 0 and S[h][w] != '#':
        dst[h][w] = d
    else:
        continue
    for i in range(4): dq.appendleft((h + dhw[i][0], w + dhw[i][1], d))
    for i in range(4, 24): dq.append((h + dhw[i][0], w + dhw[i][1], d+1))

print(dst[eh][ew])
### BUGGY CODE ###

import fractions
a,b,c,n = map(int,input().split())
d = fractions.gcd(b,c)
b = b//d
c = c//d
#print(d)
ans = 0
x,y,z = 0,0,0
while a*x <= n:
  m = n-a*x
  if m%d > 0:
    continue
  m = m//d
  y = 0
  f = 0
  while m-b*y>= 0 and y < c:
    if (m-b*y)%c == 0:
      f = 1
      break
    y += 1
  ans += f*((m-b*y)//c//b+1)
  x += 1
print(ans)

### FIXED CODE ###

import fractions
z = [0,0,0]
z[0],z[1],z[2],n = map(int,input().split())
z.sort(reverse = 1)
a,b,c = z[2],z[1],z[0]
d = fractions.gcd(b,c)
b = b//d
c = c//d
#print(d)
ans = 0
x,y,z = 0,0,0
while a*x <= n:
  m = n-a*x
  if m%d > 0:
    continue
  m = m//d
  y = 0
  f = 0
  while m-b*y>= 0 and y < c:
    if (m-b*y)%c == 0:
      f = 1
      break
    y += 1
  ans += f*((m-b*y)//c//b+1)
  x += 1
print(ans)
### BUGGY CODE ###

N, M = map(int, input().split())
A = [int(x) for x in input().split()]

B = list()
for n in range(len(A)):
    B.append([n,A[n]])
B = sorted(B, key=lambda x:x[1])
for m in range(M):
    B[-1][1] = int(B[-1][1]/2)
    B = sorted(B, key=lambda x:x[1])
res = 0
for x in B:
    res += x[1]
print(res)


### FIXED CODE ###

from heapq import *
N, M = map(int, input().split())
A = [-int(x) for x in input().split()]
heapify(A)
for x in range(M):
    tmp = int(heappop(A)/2)
    heappush(A,tmp)
res = 0
for x in A:
    res -= x
print(res)
### BUGGY CODE ###

s = list(input())
s.reverse()
s.append('0')

dp = [[1000000000] * 2 for _ in range(1000005)]
dp[0][0] = 0
n = len(s)
for i in range(n):
    for j in range(2):
        x = int(s[i])
        x += j
        for a in range(10):
            nj = 0
            otsuri = a - x
            if otsuri < 0:
                nj = 1
                otsuri += 10
            dp[i + 1][nj] = min(dp[i + 1][nj], dp[i][j] + a + otsuri)

ans = dp[n][0]
print(ans)

### FIXED CODE ###

s = list(input())
s.reverse()
s.append('0')

dp = [[1000000000] * 2 for _ in range(1000005)]
dp[0][0] = 0
n = len(s)
for i in range(n):
    for j in range(2):
        x = int(s[i])
        x += j
        if x < 10:
            dp[i + 1][0] = min(dp[i + 1][0], dp[i][j] + x)
        if x > 0:
            dp[i + 1][1] = min(dp[i + 1][1], dp[i][j] + (10 - x))

ans = dp[n][0]
print(ans)
### BUGGY CODE ###

n = int(input())
l = []
for i in range(n):
    x= list(map(int, input().split()))
    l.append(x)
def find(ele, l):
    cc = 0
    ans = []
    for i in l:
        if i==ele:
            ans.append(cc)
        cc+=1
    return ans
c = n-1
for i in l[::-1]:
    if c==n-1:
        m = max(i)
        xxx = i.copy()
        xxx.remove(m)
        m2 = max(xxx)
        if m==m2:
            count = 0
            count2 = 0
            for aa in xxx:
                if aa==m2 and count2==1:
                    ii = count
                    break
                elif aa==m2:
                    count2+=1
                count+=1
            index = [i.index(m), ii]
        else:
            index = [i.index(m), i.index(m2)]
        maxval = [m, m2]
        c-=1
        #print(index, maxval, "m")
        continue
    else:
        m = max(i)
        xxx = i.copy()
        xxx.remove(m)
        m2 = max(xxx)
        count = 0
        count2 = len(maxval)
        #print(maxval)
        found2 =find(m2,i)
        found = find(m,i)
        #print(found, found2, "Found")
        for a in maxval:
            #print(count, count2, i)
            if count==count2:
                break
            if index[count] not in found2 or len(found2)!=1:
                maxval.append(a+m2)
            if index[count] not in found or len(found)!=1:
                maxval[count]+=m
            count+=1
        if m==m2:
            index =[found[0]]*(2*count2)
        else:
            index = [found[0]]*count2+[found2[0]]*count2
        c-=1
        #print(maxval, index, "i")
print(max(maxval))

### FIXED CODE ###

n = int(input())
ans = [[0]*3 for xxx in range(n)]
for i in range(n):
    a,b,c = list(map(int, input().split()))
    if i==0:
        ans[0][0] = a
        ans[0][1] = b
        ans[0][2] = c 
        continue
    ans[i][0] += max(ans[i-1][1], ans[i-1][2]) + a
    ans[i][1] += max(ans[i-1][2], ans[i-1][0]) + b
    ans[i][2] += max(ans[i-1][0], ans[i-1][1]) + c
ans = ans[-1]
print(max(ans))
### BUGGY CODE ###

def solve():
    from heapq import heappop, heappush
    V, E = map(int, input().split())
    edges = [[] for _ in [0]*V]
    for _ in [0]*E:
        s, t, d = map(int, input().split())
        edges[s].append((t, d))

    result = float("inf")
    for i in range(V):
        q = [(0, i, {i})]
        while q:
            cost, v, visited = heappop(q)
            if len(visited) < V:
                for dest, d_cost in edges[v]:
                    if dest not in visited:
                        heappush(q, (cost+d_cost, dest, visited | {dest}))
            elif len(visited) == V:
                for dest, d_cost in edges[v]:
                    if dest == i:
                        heappush(q, (cost+d_cost, i, visited | {-1}))
            else:
                if result > cost:
                    result = cost
                break

    print(result if result < float("inf") else -1)


if __name__ == "__main__":
    solve()

### FIXED CODE ###

def solve():
    V, E = map(int, input().split())
    edges = [[] for _ in [0]*V]
    for _ in [0]*E:
        s, t, d = map(int, input().split())
        edges[s].append((t, d))

    result = float("inf")
    beam_width = 66
    for i in range(V):
        q = [(0, i, {i})]
        for j in range(V-1):
            _q = []
            append = _q.append
            for cost, v, visited in q[:beam_width+1]:
                for dest, d_cost in edges[v]:
                    if dest not in visited:
                        append((cost+d_cost, dest, visited | {dest}))
            q = sorted(_q)
        for cost, v, visited in q[:beam_width+1]:
            for dest, d_cost in edges[v]:
                if dest == i:
                    if result > cost + d_cost:
                        result = cost + d_cost
                        break

    print(result if result < float("inf") else -1)


if __name__ == "__main__":
    solve()
### BUGGY CODE ###

#!/usr/bin/env python3
n = int(input())
l = list(map(int, input().split()))
ans = 1
for i in range(1, n):
    flag = True
    #print("i", i)
    for s in range(i):
        #print("s", s)
        if l[s] < l[i]:
            flag = False
            break
    if flag:
        ans += 1
print(ans)


### FIXED CODE ###

#!/usr/bin/env python3
n = int(input())
l = list(map(int, input().split()))
ans = 1
min_l = l[0]
for i in range(1, n):
    if min_l > l[i]:
        ans += 1
        min_l = l[i]
print(ans)
### BUGGY CODE ###

n = int(input())
p = list(map(int, input().split()))
ans = 0
for k in range(1, max(p) + 1):
    abc = 0
    arc = 0
    for i in p:
        if i < k:
            abc += 1
        else:
            arc += 1
    if abc == arc:
        ans += 1
print(ans)


### FIXED CODE ###

n = int(input())
p = sorted(list(map(int, input().split())))
a = int(len(p) / 2)
if p[a-1] == p[a]:
    print(0)
else:
    print(p[a] - p[a-1])
### BUGGY CODE ###

import math
N = int(input())
z = 0
for a in range(N):
    e = min(a,math.floor(N/(a+1)))
    for b in range(e):
        if N - (a+1)*(b+1) > 0:
            z = z+2
        else:
            pass
    if N - (a+1)*(a+1) > 0:
        z = z+1
    else:
        pass
print(z)

### FIXED CODE ###

import math
N = int(input())
z = 0
for a in range(N):
    for b in range(min(a,math.floor(N/(a+1)))):
        if N - (a+1)*(b+1) > 0:
            z = z+2
        else:
            pass
    if N - (a+1)*(a+1) > 0:
        z = z+1
    else:
        pass
print(z)
### BUGGY CODE ###

S = input()

length = len(S)
dp = [[0] * 13 for _ in range(length + 1)]
dp[0][0] = 1
mul = 1
INF = 10 ** 9 + 7

for i in range(length):
    
    x = S[- (i + 1)]
    
    if x == "?":
        
        for j in range(13):
            
            for k in range(10):
            
                dp[i + 1][(k * mul + j) % 13] += dp[i][j]
                dp[i + 1][(k * mul + j) % 13] %= INF
                
    else:
        
        c = int(x)
        
        for j in range(13):
            
            dp[i + 1][(c * mul + j) % 13] += dp[i][j]
            dp[i + 1][(c * mul + j) % 13] %= INF
            
    mul = (mul * 10) % 13
    
print(dp[length][5])


### FIXED CODE ###

S = input()

length = len(S)
dp = [[0] * 13 for _ in range(length + 1)]
dp[0][0] = 1
mul = 1
INF = 10 ** 9 + 7

for i in range(length):
    
    x = S[- (i + 1)]
    
    if x == "?":
        
        for j in range(13):
            
            for k in range(10):
            
                dp[i + 1][(k * mul + j) % 13] += dp[i][j]
                dp[i + 1][(k * mul + j) % 13] %= INF
                
    else:
        
        c = int(x)
        
        for j in range(13):
            
            dp[i + 1][(c * mul + j) % 13] += dp[i][j]
            dp[i + 1][(c * mul + j) % 13] %= INF
            
    mul = (mul * 10) % 13
    
print(dp[length][5])
### BUGGY CODE ###

# -*- coding: utf-8 -*-
N = int(input())
a = list(map(int, input().split()))

sunuke_l = []
sunuke = 0
arai_l = []
arai = 0
all_sum = sum(a)
diff_l = []
for i in range(1,N):
    sunuke = sum(a[0:i])
    arai = all_sum - sunuke
    diff_l.append(abs(sunuke - arai))

print(min(diff_l))


### FIXED CODE ###

# -*- coding: utf-8 -*-
N = int(input())
a = list(map(int, input().split()))

sunuke_l = []
sunuke = 0
arai_l = []
arai = 0
all_sum = sum(a)
diff_l = []
for i in range(N-1):
    sunuke = sunuke + a[i]
    arai = all_sum - sunuke
    diff_l.append(abs(sunuke - arai))

print(min(diff_l))
### BUGGY CODE ###

from itertools import combinations as c

n = int(input())
s = input()

ans = 0
for i in range(n): # i+1文字取り出す場合
    num = i+1
    l = list(c(s, num))
    for j in l:
        if len(j) == len(set(j)):
            ans += 1

print(ans)

### FIXED CODE ###

from collections import Counter

n = int(input())
s = list(input())
c = Counter(s)
m = 10**9 + 7

ans = 1
for i in c:
    ans *= (c[i] + 1)
    ans %= m
ans -= 1

print(ans)