Harryxun/stf_run huggingface dataset:
A, B = map(int, input().split())

print(6-A-B)

### FIXED CODE ###

A = int(input())
B = int(input())

print(6-A-B)
def inpl(): return [int(i) for i in input().split()]
import numpy as np
N, x = inpl()
a = np.array(inpl())
b = np.copy(a)
ans = float('inf') 
for i in range(N):
    c = np.roll(a,i)
    b = np.minimum(b,c)
    ans = min(ans, sum(b)+i*x)
print(ans)


### FIXED CODE ###

import numpy as np
N, x = map(int, input().split())
a = np.array(list(map(int, input().split())))
b = np.copy(a)
ans = float('inf') 
for i in range(N):
    c = np.roll(a,i)
    b = np.minimum(b,c)
    ans = min(ans, sum(b)+i*x)
print(ans)
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from collections import deque
import math


def inputIntList():
  return [int(s) for s in input().split()]


def inputInt():
  return int(input())


def main():
  H, W = inputIntList()
  S = [[s for s in input()] for _ in range(H)]

  ans = 0
  for si in range(H):
    for sj in range(W):
      if S[si][sj] == '#':
        continue

      dist = [[-1 for _ in range(W)] for _ in range(H)]
      q = deque()

      def update(pos, num):
        i, j = pos
        if dist[i][j] != -1:
          return
        dist[i][j] = num
        q.append(pos)
        ans = max(ans, num)

      start = (si, sj)
      update(start, 0)

      while q:
        qi, qj = q.popleft()
        for di, dj in (-1, 0), (0, -1), (1, 0), (0, 1):
          ni = qi + di
          nj = qj + dj
          if ni < 0 or ni >= H:
            continue
          if nj < 0 or nj >= W:
            continue
          if S[ni][nj] == '#':
            continue
          update((ni, nj), dist[qi][qj]+1)

    return ans


if __name__ == "__main__":
  print(main())


### FIXED CODE ###

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


def inputIntList():
  return [int(s) for s in input().split()]


def inputInt():
  return int(input())


def main():
  H, W = inputIntList()
  S = [[s for s in input()] for _ in range(H)]

  ans = 0
  for si in range(H):
    for sj in range(W):
      if S[si][sj] == '#':
        continue

      dist = [[-1 for _ in range(W)] for _ in range(H)]
      q = deque()

      start = (si, sj)
      if dist[si][sj] == -1:
        dist[si][sj] = 0
        q.append(start)

      while q:
        qi, qj = q.popleft()
        for di, dj in (-1, 0), (0, -1), (1, 0), (0, 1):
          ni = qi + di
          nj = qj + dj
          if ni < 0 or ni >= H:
            continue
          if nj < 0 or nj >= W:
            continue
          if S[ni][nj] == '#':
            continue
          if dist[ni][nj] == -1:
            dist[ni][nj] = dist[qi][qj]+1
            q.append((ni, nj))
            ans = max(ans, dist[ni][nj])
  return ans


if __name__ == "__main__":
  print(main())
n,A,B,C=map(int,input().split())
r=[A,B,C]
g=list()
for i in range(n):
    g.append(str(input()))
    
def re(string):
    if string=="AB":
        return(0,1)
    elif string=="AC":
        return(0,2)
    else:
        return(1,2)
    
def al(num):
    if num==0:
        return "A"
    elif num==1:
        return "B"
    else:
        return "C"
    
flag=0
result=list()
for i in range(n):
    a,b=re(g[i])
    if r[a]==0 and r[b]==0:
        print("No")
        flag=1
        break
    elif r[a]>r[b]:
        r[a]-=1
        r[b]+=1
        result.append(al(b))
    elif r[a]<r[b]:
        r[a]+=1
        r[b]-=1
        result.append(al(a))
    else:
        x,y=re(g[i+1])
        if (x,y)==(a,b):
            r[a]+=1
            r[b]-=1
            result.append(al(a))
        else:
            if x in (a,b):
                r[x]+=2
                r[a]-=1;r[b]-=1
                result.append(al(x))
            else:
                r[y]+=2
                r[a]-=1;r[b]-=1
                result.append(al(y))
        
if flag==0:
    print("Yes")
    for item in result:
        print(item)

### FIXED CODE ###

n,A,B,C=map(int,input().split())
r=[A,B,C]
g=list()
for i in range(n):
    g.append(str(input()))
    
def re(string):
    if string=="AB":
        return(0,1)
    elif string=="AC":
        return(0,2)
    else:
        return(1,2)
    
def al(num):
    if num==0:
        return "A"
    elif num==1:
        return "B"
    else:
        return "C"
    
flag=0
result=list()
for i in range(n):
    a,b=re(g[i])
    if r[a]==0 and r[b]==0:
        print("No")
        flag=1
        break
    elif r[a]>r[b]:
        r[a]-=1
        r[b]+=1
        result.append(al(b))
    elif r[a]<r[b]:
        r[a]+=1
        r[b]-=1
        result.append(al(a))
    else:
        if i+1==n:
            r[a]+=1
            r[b]-=1
            result.append(al(a))
            break
        x,y=re(g[i+1])
        if (x,y)==(a,b):
            r[a]+=1
            r[b]-=1
            result.append(al(a))
        else:
            if x in (a,b):
                r[x]+=2
                r[a]-=1;r[b]-=1
                result.append(al(x))
            else:
                r[y]+=2
                r[a]-=1;r[b]-=1
                result.append(al(y))
        
if flag==0:
    print("Yes")
    for item in result:
        print(item)
def lcm(a):
    from fractions import gcd
    x = a[0]
    for i in range(1, len(a)):
        x = (x * a[i]) // gcd(x, a[i])
    return x

m = int(input())
n = int(input())
a =  [m, n]
print(lcm(a))

### FIXED CODE ###

def lcm(a):
    from fractions import gcd
    x = a[0]
    for i in range(1, len(a)):
        x = (x * a[i]) // gcd(x, a[i])
    return x

a =  (input().split())
b = [1, 1]
b[0] = int(a[0])
b[1] = int(a[1])
print(lcm(b))
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

import numpy as np

MOD = 10 ** 9 + 7

N = int(readline())
A = np.array(read().split())

answer = 0
for n in range(63):
    B = (A >> n) & 1
    x = np.count_nonzero(B)
    y = N - x
    x *= y
    for _ in range(n):
        x *= 2
        x %= MOD
    answer += x
answer %= MOD
print(answer)


### FIXED CODE ###

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

import numpy as np

MOD = 10 ** 9 + 7

N = int(readline())
A = np.array(read().split(),np.int64)

answer = 0
for n in range(63):
    B = (A >> n) & 1
    x = np.count_nonzero(B)
    y = N - x
    x *= y
    for _ in range(n):
        x *= 2
        x %= MOD
    answer += x
answer %= MOD
print(answer)
z = list(map(int, input().split()))
x = z[0]
if z[1] == 0:
  print(z[0])
else:
  p = list(map(int, input().split()))
  count = 0
  l = []
  for i in range(1, 101):
    l.append(i)
  for i in p:
    l.remove(i)
  t = 200
  for i in l:
    e = abs(x-i)
    if e >= t:
      break
    t = e
    ans = i
  print(ans)

### FIXED CODE ###

z = list(map(int, input().split()))
x = z[0]
if z[1] == 0:
  print(x)
else:
  p = list(map(int, input().split()))
  l = []
  for i in range(-1, 102):
    l.append(i)
  for i in p:
    l.remove(i)
  t = 200
  for i in l:
    e = abs(x-i)
    if e >= t:
      break
    t = e
    ans = i
  print(ans)
X = list(input().split())
if X.count("5") == 2 and X.count("7") == 1:
  print("YES")
  else print("NO")

### FIXED CODE ###

X = list(input().split())
if X.count("5") == 2 and X.count("7") == 1:
    print("YES")
else:
    print("NO")
from collections import defaultdict
import sys
sys.setrecursionlimit(10000)
N,M=list(map(int,input().split()))
links=defaultdict(list)
for i in range(N):
    a,b=list(map(int, input().split()))
    links[a].append(b)
    links[b].append(a)
ct=0
def DFS(idx,visited):
    visited.add(idx)
    for i in links[idx]:
        if i in visited:
            continue
        visi=set(visited)
        DFS(i,visi)
        if len(visi)==N:
            global ct
            ct+=1
DFS(1,set())
print(ct)

### FIXED CODE ###

from collections import defaultdict
import sys
sys.setrecursionlimit(10000)
N,M=list(map(int,input().split()))
links=defaultdict(list)
for i in range(M):
    a,b=list(map(int, input().split()))
    links[a].append(b)
    links[b].append(a)
ct=0
visited=[False]*N
def DFS(idx):
    global visited
    if all(visited):
        global ct
        ct+=1
        return
    for i in links[idx]:
        if visited[i-1]:
            continue
        visited[i-1]=True
        DFS(i)
        visited[i-1]=False
visited[0]=True
DFS(1)
print(ct)
import math

def nCk(n, k):
    return math.factorial(n) / (math.factorial(k) * math.factorial(n - k))

N, K = map(int, input().split())

for i in range(1, K + 1):
    print(int((nCk(N-K+1, i) * nCk(K-1, i-1)) % (10**9 + 7)))

### FIXED CODE ###

from math import factorial

N, K = map(int, input().split())
mod = 10**9 + 7

def cmb(n, r):
    if n >= r:
        return int(factorial(n) // (factorial(r) * factorial(n-r)))
    else:
        return 0

for i in range(1, K+1):
    print(cmb(N-K+1, i) * cmb(K-1, i-1) % mod)
import heapq
import math
#これを加える！！！！
def _heappush_max(heap, item):
    heap.append(item)
    heapq._siftdown_max(heap, 0, len(heap)-1)
def _heappop_max(heap):
    """Maxheap version of a heappop."""
    lastelt = heap.pop()    # raises appropriate IndexError if heap is empty
    if heap:
        returnitem = heap[0]
        heap[0] = lastelt
        heapq._siftup_max(heap, 0)
        return returnitem
    return lastelt

"""
a = [1,7,3,5,4]

#heapify
#配列a = [1,7,3,5,4]をheapにする
heapq._heapify_max(a)
print(a) #[7, 5, 3, 1, 4]

#heappop
#最大値の取り出し
print(_heappop_max(a)) #7
print(a) #[5, 4, 3, 1]

#heappush
#要素(2)の挿入
_heappush_max(a,2)
print(a) #[5, 4, 3, 1, 2]

#最大値の取り出し
print(_heappop_max(a)) #5
"""

N, M = map(int, input().split())
a = [int(i) for i in input().split()]
heapq._heapify_max(a)

okaiage = []
heapq._heapify_max(okaiage)
_heappush_max(okaiage, _heappop_max(a)/2)

m = M - 1
for j in range(N-1):
    temp_oka = _heappop_max(okaiage)
    temp_a = _heappop_max(a)
    #print(temp_oka, temp_a)
    if m > 0:
        if temp_a > temp_oka:
            _heappush_max(okaiage, temp_a/2)
            _heappush_max(okaiage, temp_oka)
        else:
            _heappush_max(okaiage, temp_a)
            _heappush_max(okaiage, temp_oka/2)
    else:
        _heappush_max(okaiage, temp_a)
        _heappush_max(okaiage, temp_oka)
    m -= 1
if m > 0:
    for i in range(m):
        temp_oka = _heappop_max(okaiage) / 2
        _heappush_max(okaiage, temp_oka)
#print(okaiage)
okaiage_kiri = [int(math.floor(_heappop_max(okaiage))) for i in range(N)]
#print(okaiage_kiri)
print(sum(okaiage_kiri))


### FIXED CODE ###

import heapq
import math
#これを加える！！！！
def _heappush_max(heap, item):
    heap.append(item)
    heapq._siftdown_max(heap, 0, len(heap)-1)
def _heappop_max(heap):
    """Maxheap version of a heappop."""
    lastelt = heap.pop()    # raises appropriate IndexError if heap is empty
    if heap:
        returnitem = heap[0]
        heap[0] = lastelt
        heapq._siftup_max(heap, 0)
        return returnitem
    return lastelt

"""
a = [1,7,3,5,4]

#heapify
#配列a = [1,7,3,5,4]をheapにする
heapq._heapify_max(a)
print(a) #[7, 5, 3, 1, 4]

#heappop
#最大値の取り出し
print(_heappop_max(a)) #7
print(a) #[5, 4, 3, 1]

#heappush
#要素(2)の挿入
_heappush_max(a,2)
print(a) #[5, 4, 3, 1, 2]

#最大値の取り出し
print(_heappop_max(a)) #5
"""

N, M = map(int, input().split())
a = [int(i) for i in input().split()]
heapq._heapify_max(a)

for j in range(M):
    _heappush_max(a, _heappop_max(a)//2)
print(sum(a))
A=[ord(i) for i in range(chr(a),chr(z)+1)]
a=input()
if a in A:
  print("a")
else:
  print("A")

### FIXED CODE ###

A=[chr(i) for i in range(ord("a"),ord("z")+1)]
a=input()
if a in A:
  print("a")
else:
  print("A")
N, A, B = list(map(int, input().split()))

blue_num = A * (N // (A + B)) + (N % (A + B) % A)
print(blue_num)


### FIXED CODE ###

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

try:
    blue_num = A * (N // (A + B))
    residue = N - ((A + B) * (N // (A + B)))
    if(residue > A):
        blue_num += A
    else:
        blue_num += residue
except ZeroDivisionError:
    blue_num = 0

print(blue_num)
import itertools
import math
from collections import deque
from collections import defaultdict
from itertools import permutations
import heapq
import bisect
from scipy.sparse.csgraph import floyd_warshall as wf
INF = float("inf")


N,M = map(int,input().split())
Adj_list = defaultdict(set)

for i in range(M):
    a, b, c = map(int, input().split())
    Adj_list[a-1].add((b-1, c))
    Adj_list[b-1].add((a-1, -c))
visited =[None]*(N)
ok = True
stack = []
for x in range(N):
   if visited[x] is not None:continue
   visited[x] = 0
   stack = [x]
   while stack:
       v = stack.pop()
       for to,d in Adj_list[v]:
           if visited[to] is None:
               visited[to] = G[v] + d
               stack.append(to)
           else:
               if G[to] != G[v]+d:
                   ok = False
                   break
   if ok == False:
        break
print("Yes" if ok else "No")


### FIXED CODE ###

import itertools
import math
from collections import deque
from collections import defaultdict
from itertools import permutations
import heapq
import bisect
from scipy.sparse.csgraph import floyd_warshall as wf
INF = float("inf")


N,M = map(int,input().split())
Adj_list = defaultdict(set)

for i in range(M):
    a, b, c = map(int, input().split())
    Adj_list[a-1].add((b-1, c))
    Adj_list[b-1].add((a-1, -c))
visited =[None]*(N)
ok = True
stack = []
for x in range(N):
   if visited[x] is not None:continue
   visited[x] = 0
   stack = [x]
   while stack:
       v = stack.pop()
       for to,d in Adj_list[v]:
           if visited[to] is None:
               visited[to] = visited[v] + d
               stack.append(to)
           else:
               if visited[to] != visited[v]+d:
                   ok = False
                   break
   if ok == False:
        break
print("Yes" if ok else "No")
a=input()
b=input()
z=len(a)
for i in range(0,z):
  if a==b[i:]+b[:i] : 
    print("Yes")
    Exit(0)
print("No")

### FIXED CODE ###

a=input()
b=input()
z=len(a)
for i in range(0,z):
  if a==b[i:]+b[:i] : 
    print("Yes")
    exit(0)
print("No")
# -*- coding: utf-8 -*-

# AtCoder Beginner Contest
# Problem C

if __name__ == '__main__':
    from itertools import accumulate
    from bisect import bisect_left

    n = int(input())
    a = sorted(list(map(int, input().split())))
    summed_a = list(accumulate(a))
    x = bisect_left(summed_a, max(summed_a) // 2)

    if x == n - 1:
        x -= 1
    elif x == 0:
        x += 1

    print(abs(max(summed_a) - 2 * summed_a[x]))


### FIXED CODE ###

# -*- coding: utf-8 -*-

# AtCoder Beginner Contest
# Problem C

if __name__ == '__main__':
    from itertools import accumulate

    n = int(input())
    a = list(map(int, input().split()))

    # See:
    # https://atcoder.jp/img/arc078/editorial.pdf
    # total_a = sum(a)
    summed_a = [0] + list(accumulate(a))
    total_a = sum(a)
    diff = float('inf')

    for i in range(1, n):
        diff = min(diff, abs(total_a - 2 * summed_a[i]))

    print(diff)
n=int(input())
ret=[2,3,4] if n>=6 else [2,3,25] if n==3 else [2,3,5,30] if n==4 else [2,3,5,30,60]
if n>=6:
    def getnext(a):
        if a%6==0:
            return a+2
        elif a%6==2:
            return a+1
        elif a%6==3:
            return a+1
        elif a%6==4:
            return a+2
    while len(ret)<n:
        ret.append(getnext(ret[-1]))
    if sum(ret)%6==5:
        ret[-1]=getnext(ret[-1])
    elif sum(ret)%6!=0:
        ret.remove((sum(ret)%6)+6)
        ret.append(getnext(ret[-1]))
        while sum(ret)%6!=0:
            ret[-1]=getnext(ret[-1])
    print(" ".join(map(str,ret)))
else:
    print(" ".join(ret))

### FIXED CODE ###

n=int(input())
ret=[2,3,4] if n>=6 else [2,5,63] if n==3 else [2,5,20,63] if n==4 else [2,5,20,30,63]
if n>=6:
    def getnext(a):
        if a%6==0:
            return a+2
        elif a%6==2:
            return a+1
        elif a%6==3:
            return a+1
        elif a%6==4:
            return a+2
    while len(ret)<n:
        ret.append(getnext(ret[-1]))
    if sum(ret)%6==5:
        ret[-1]=getnext(ret[-1])
    elif sum(ret)%6!=0:
        ret.remove((sum(ret)%6)+6)
        ret.append(getnext(ret[-1]))
        while sum(ret)%6!=0:
            ret[-1]=getnext(ret[-1])
print(" ".join(map(str,ret)))
import sys

def main():
    N = int(input().split())
    S = input()

    cnt = 0
    for i in range(N-2):
        s = str(S[i]) + str(S[i+1]) + str(S[i+2])
        if s=='ABC':
            cnt += 1

    print(cnt)
main()

### FIXED CODE ###

import sys

def main():
    N = int(input())
    S = input()

    cnt = 0
    for i in range(N-2):
        s = str(S[i:i+3])
        if s=='ABC':
            cnt += 1

    print(cnt)
main()
N, M=map(int, input().split())
x=[]
y=[]
for i in range(M):
  a, b=map(int, input().split())
  if a==1:
    x.append(b)
  if b==1:
    x.append(a)
  if a==N:
    y.append(b)
  if b==N:
    y.append(a)
    
x.sort()
y.sort()
i=0
j=0
out='IMPOSSIBLE'
nx=len(x)
ny=len(y)
while i+j<nx+ny-1:
  if x[i]==y[j]:
    out='POSSIBLE'
    break
  elif x[i]>y[j]:
    j+=1
  else:
    i+=1
    
print(out)

### FIXED CODE ###

N, M=map(int, input().split())
x=[]
y=[]
for i in range(M):
  a, b=map(int, input().split())
  if a==1:
    x.append(b)
  if b==N:
    y.append(a)
    
nx=len(x)
ny=len(y)

if nx==0 or ny==0:
  print('IMPOSSIBLE')
  exit()

x.sort()
y.sort()
i=0
j=0
out='IMPOSSIBLE'

while i+j<nx+ny-1:
  if x[i]==y[j]:
    out='POSSIBLE'
    break
  elif x[i]>y[j]:
    j+=1
  else:
    i+=1
    
print(out)
import heapq

N = int(input())
E = [list(map(lambda x: int(x)-1,input().split())) for _ in range(N-1)]
C = list(map(lambda x: int(x)*(-1),input().split()))
heapq.heapify(C)

V = [set() for _ in range(N)]
for u,v in E:
  V[u].add(v)
  V[v].add(u)

A = [0 for _ in range(N)]
def dfs(v,s):
  A[v] = -heapq.heappop(C)
  for u in V[v]:
    if u != s:
      dfs(u,v)
dfs(0,-1)
print(*A)


### FIXED CODE ###

import sys
sys.setrecursionlimit(10 ** 9)
import heapq

N = int(input())
E = [list(map(lambda x: int(x)-1,input().split())) for _ in range(N-1)]
C = sorted(list(map(lambda x: int(x)*(-1),input().split())))
m = -sum(C[1:])
heapq.heapify(C)

V = [set() for _ in range(N)]
for u,v in E:
  V[u].add(v)
  V[v].add(u)

A = [0 for _ in range(N)]
def dfs(v,s):
  A[v] = -heapq.heappop(C)
  for u in V[v]:
    if u != s:
      dfs(u,v)
dfs(0,-1)

print(m)
print(*A)
n,k = map(int,input().split())
A = list(map(int,input().split()))

b = 1
c = 0
while b <= k:
  b *= 2
  c += 1

B = [0]*(c+1)
for a in A:
  for i in range(c):
    if a>>i & 1 :      
      B[i] += 1
    
x = 0
for i in range(c):
  if B[i] <= n/2:
    x += 1<<i
    
flag = 0    
for i in range(c):
  if k>>(4-i) == 0 and x>>(4-i)==1:
    x -= 1<<(4-i)
    break

ans = 0
for a in A:
  ans += x^a
  
print(ans)  

### FIXED CODE ###

n,k = map(int,input().split())
A = list(map(int,input().split()))

b = 1
c = 0
while b <= k:
  b *= 2
  c += 1

B = [0]*(c)
for a in A:
  for i in range(c):
    if a>>i & 1 :      
      B[i] += 1
      
x = 0
for b in range(c,-1,-1):
  if x + (1<<b) > k:
    continue
  if B[b] < (n+1)//2:
    x += 1<<b
    
ans = 0
for a in A:
  ans += x^a
print(ans)
n,p = map(int,input().split())
s = input()
count = 0

if p == 2 or p == 5:
    for i in range(n):
        if int(s[i])%p == 0:
            count += i+1
else:
    u = [0]*p
    u[0] += 1
    for i in range(n):
        u[int(s[i:])%p] += 1
    
    for i in u:
        count += i*(i-1)//2
    
print(count)

### FIXED CODE ###

s = input()

if s[0]==s[1] and s[0]==s[2]:
    print('No')
else:
    print('Yes')
from sys import stdin
from math import sqrt


def is_prime(q, primes):
    if len(primes) == 0:
        return True
    for prime in primes:
        if q % prime == 0:
            return False
    return True

def get_primes(n):
    # special case
    if n < 2:
        return []

    max = int(sqrt(n))
    primes = []
    for q in range(2, max+1):
        if is_prime(q, primes):
            primes.append(q)

    return primes

def breakdown_to_primes_as_dic(n, primes):
    prime_dic = {}
    for prime in primes:
        if n % prime != 0:
            continue
        prime_dic[prime] = 0
        while n % prime == 0:
            prime_dic[prime] += 1
            n = n // prime
    if n != 1:
        prime_dic[n] = 1
    return prime_dic

def get_int_sums(n):
    int_sums = [0]
    for i in range(1, n+1):
        int_sums.append(int_sums[i-1] + i)
    int_sums.pop(0)
    return int_sums


def main():
    for line in stdin:
        n = int(line)
        break

    primes = get_primes(n)
    prime_dic = breakdown_to_primes_as_dic(n, primes)

    max_prime_occurance = max(prime_dic.values())
    int_sums = get_int_sums(max_prime_occurance + 1)

    answer = 0
    for prime in prime_dic.keys():
        occr = prime_dic[prime]
        for i in range(1, len(int_sums)):
            if occr >= int_sums[i-1] and occr < int_sums[i]:
                answer += i
                break

    print(answer)

main()

### FIXED CODE ###

from sys import stdin
from math import sqrt


def is_prime(q, primes):
    if len(primes) == 0:
        return True

    maxq = int(sqrt(q))
    for prime in primes:
        if prime > maxq:
            break
        if q % prime == 0:
            return False
    return True

def get_primes(n):
    if n < 2:
        return []
    if n == 2:
        return [2]

    max = int(sqrt(n))
    primes = [2]
    for q in range(3, max+1):
        if is_prime(q, primes):
            primes.append(q)

    return primes

def breakdown_to_primes_as_dic(n, primes):
    prime_dic = {}
    for prime in primes:
        if n % prime != 0:
            continue
        prime_dic[prime] = 0
        while n % prime == 0:
            prime_dic[prime] += 1
            n = n // prime
    if n >= 2:
        prime_dic[n] = 1
    return prime_dic

def get_int_sums(n):
    int_sums = [0]
    for i in range(1, n+1):
        int_sums.append(int_sums[i-1] + i)
    int_sums.pop(0)
    return int_sums


def main():
    for line in stdin:
        n = int(line)
        break

    primes = get_primes(n)
    prime_dic = breakdown_to_primes_as_dic(n, primes)

    if len(prime_dic.keys()) == 0:
        print(0)
        return

    max_prime_occurance = max(prime_dic.values())
    int_sums = get_int_sums(max_prime_occurance + 1)

    answer = 0
    for prime in prime_dic.keys():
        occr = prime_dic[prime]
        for i in range(1, len(int_sums)):
            if occr >= int_sums[i-1] and occr < int_sums[i]:
                answer += i
                break

    print(answer)


main()
import collections
a = list(input())
b = list(input())
A = collections.Counter(a)
B = collections.Counter(b)
Asort = sorted(A.values())
Bsort = sorted(B.values())
if Asort.values() == Bsort.values():
  print("Yes")
else:
  print("NO")

### FIXED CODE ###

import collections
a = list(input())
b = list(input())
A = collections.Counter(a)
B = collections.Counter(b)
Alist = list(A.values())
Blist = list(B.values())
Asort = sorted(Alist)
Bsort = sorted(Blist)
if Asort == Bsort:
  print("Yes")
else:
  print("No")
N = map(int, input())
cards = map(int, input().split())

cards.sort(reverse=True)
 
sum_A = 0
sum_B = 0
 
for i in range(N):
    if i % 2 == 0:
        sum_A += cards[i]
    else:
        sum_B += cards[i]

print(sum_A - sum_B)

### FIXED CODE ###

N = int(input())
cards = list(map(int,input().split()))
 
cards.sort(reverse=True)
 
sum_A = 0
sum_B = 0
 
for i in range(N):
    if i % 2 == 0:
        sum_A += cards[i]
    else:
        sum_B += cards[i]
print(sum_A - sum_B)