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

#create date: 2020-08-11 09:28

import sys
stdin = sys.stdin
from itertools import product

def ns(): return stdin.readline().rstrip()
def ni(): return int(ns())
def na(): return list(map(int, stdin.readline().split()))

def main():
    n = ni()
    s = ns()
    ans = 0

    for a in product(range(10), repeat=3):
        i = 0
        for si in s:
            if int(si) == a[i]:
                i += 1
            if i == 3:
                ans += 1
                break
    print(ans)

if __name__ == "__main__":
    main()

### FIXED CODE ###

#create date: 2020-08-11 09:28

import sys
stdin = sys.stdin
from itertools import product

def ns(): return stdin.readline().rstrip()
def ni(): return int(ns())
def na(): return list(map(int, stdin.readline().split()))

def main():
    n = ni()
    s = ns()
    ans = 0

    for a in product(range(10), repeat=3):
        i = 0
        for si in s:
            if int(si) == a[i]:
                i += 1
            if i == 3:
                ans += 1
                break
    print(ans)

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


S = input()

mod = 2019
ctr = [0] * mod
t = 0
for i, v in enumerate(S[::-1]):
    t = (t + int(v) * 10 ** i) % mod
    ctr[t] += 1

ans = ctr[0]
for v in ctr[1:]:
    ans += v * (v - 1) // 2
print(ans)


### FIXED CODE ###


S = list(map(int, list(input())))

mod = 2019
ctr = [0] * mod
t = 0
for i, v in enumerate(reversed(S)):
    t = (t + int(v) * pow(10, i, mod)) % mod
    ctr[t] += 1

ans = ctr[0]
for v in ctr:
    ans += v * (v - 1) // 2
print(ans)
### BUGGY CODE ###

import numpy as np

MOD = 10**9 + 7
def solve(n, a, p=60):
    s = np.zeros(p, dtype=int)
    t = np.zeros(p, dtype=int)
    a = a[::-1]
    for i in range(n):
        mask = bin(a[i])[2:].zfill(p)[::-1]
        mask = np.asarray(list(map(int, mask)), dtype=int)
        s += mask
        t += mask * (i+1-s) + (1-mask) * s
    res = 0
    for j in range(p):
        res += int(t[j]) * (2**j)
    return res % MOD

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

### FIXED CODE ###

MOD = 10**9 + 7
def solve(n, a, p=60):
    res, m = 0, 1
    for i in range(p):
        y = sum(x & m for x in a) // m
        res += y * (n-y) * m
        m *= 2
    return res % MOD

n = int(input())
a = list(map(int, input().split()))
print(solve(n, a))
### BUGGY CODE ###

from itertools import count
n = int(input())
l = [ int(input()) for i in range(n)]
ans = tuple(sorted(l))

checked = set()

s = [(l, 0)]
for loop_count in count():
    #print(loop_count, len(s), len(checked))
    #print(s, checked)
    tl, ns = s.pop(0)
    if tuple(tl) in checked:
        continue
    if ans == tuple(tl):
        print(ns)
        break
    for i in range(n):
        n1 = list(tl)
        c = n1.pop(i)
        n1.append(c)
        if(tuple(n1) not in checked):
            s.append((n1, ns+1))
        n2 = list(tl)
        c = n2.pop(i)
        n2.insert(0, c)
        if(tuple(n2) not in checked):
            s.append((n2, ns+1))
    checked.add(tuple(tl))


### FIXED CODE ###

def main():
    n = int(input())
    l = [ int(input().rstrip()) for i in range(n)]

    s = {}
    for i in l:
        if i - 1 in s:
            s[i] = s[i - 1] + 1
            del s[i - 1]
        else:
            s[i] = 1
    print(n - max(s.values()))

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

N = int(input())
S = input()
count_R = 0
count_G = 0
count_B = 0
count_2 = 0
R = []
G = []
B = []


for i in range(N):
    if S[i] == 'R':
        count_R = count_R+1
        R.append(i)
    elif S[i] == 'G':
        count_G = count_G+1
        G.append(i)
    else:
        count_B = count_B+1
        B.append(i)
count = count_R*count_G*count_B

for i in range(len(R)):
    for j in range(len(G)):
        for k in range(len(B)):
            if R[i]+B[k] == 2*G[j]:
                count_2 = count_2+1
            elif R[i]+G[j] == 2*B[k]:
                count_2 = count_2+1
            elif G[j]+B[k] == 2*R[i]:
                count_2 = count_2+1
                

ans = count-count_2
print(ans)

### FIXED CODE ###

N = int(input())
S = input()
count_R = 0
count_G = 0
count_B = 0
count = 0
for i in range(N):
    if S[i] == 'R':
        count_R = count_R+1
    elif S[i] == 'G':
        count_G = count_G+1
    else:
        count_B = count_B+1
count = count_R*count_G*count_B

for i in range(N):
  for j in range(i+1,N):
    if S[i] != S[j]:
      k = 2*j-i
      if k>=N:
        break
      else:
        if S[i] != S[k] and S[j] != S[k]:
          count = count-1
print(count)
### BUGGY CODE ###

from sys import stdin
S = (stdin.readline().rstrip())
dp = [[0]*13 for i in range(len(S)+1)]
MOD = 10**9+7

S = list(reversed(S))
a = [0] + [(10**i) % 13 for i in range(len(S))]
dp[0][0] = 1

cnt = 1
for i, c in enumerate(S, 1):
    for j in range(13):
        if c == "?":
            for k in range(10):
                nj = (k*a[i]+j) % 13
                dp[i][nj] = dp[i][nj] + dp[i-1][j]
                dp[i][nj] %= MOD
        else:
            nj = (int(c)*a[i]+j) % 13
            dp[i][nj] = dp[i][nj] + dp[i-1][j]
            dp[i][nj] %= MOD
print(dp[-1][5])

### FIXED CODE ###

from sys import stdin
S = (stdin.readline().rstrip())
dp = [[0]*13 for i in range(len(S)+1)]
MOD = 10**9+7
 
S = list(reversed(S))
dp[0][0] = 1
 
t = 1
for i, c in enumerate(S, 1):
    for j in range(13):
        if c == "?":
            for k in range(10):
                nj = (k*t+j) % 13
                dp[i][nj] = dp[i][nj] + dp[i-1][j]
                dp[i][nj] %= MOD
        else:
            nj = (int(c)*t+j) % 13
            dp[i][nj] = dp[i][nj] + dp[i-1][j]
            dp[i][nj] %= MOD
    t = (t*10)%13
print(dp[-1][5])
### BUGGY CODE ###

n,k=map(int, input().split())
l=list(map(int, input().split()))
if k>=n:
    print("0")
    exit(0)

t=n-k
sum=0
for i in range(t):
    m=min(l)
    sum=sum+m
    l.remove(m)

print(sum)

### FIXED CODE ###

n,k=map(int, input().split())
l=list(map(int, input().split()))
if k>=n:
    print("0")
    exit(0)

l.sort()

sum=0
for i in range(n-k):
    sum=sum+l[i]

print(sum)
### BUGGY CODE ###

N = int(input())
AN = list((map(int,input().split(" "))))

AN.sort(reverse=True)

num = 0
count = 0
ccc = 0

while True:

    if len(AN) == 0:
        break

    A = AN.pop(num)
    ccc += 1

    for i in range(len(AN)):
        n = A + AN[i]
        if (n & (n - 1) == 0):
            AN.pop(i)
            count += 1
            break
    
    if ccc > 200001:
        break

print(count)

### FIXED CODE ###

N = int(input())
A = list(map(int,input().split(" ")))
A.sort()
used = [0] * N
pow2_set = reversed([ 1<<i for i in range(36)])
ans = 0
for pow2 in pow2_set:
    l,r = 0,N-1
    while l < r:
        if A[l] + A[r] < pow2:
            l += 1
        elif A[l] + A[r] == pow2:
            if used[l] == 0 and used[r] == 0:
                ans += 1
                used[l],used[r] = 1,1
            else:
                if used[l] == 1:
                    l += 1
                if used[r] == 1:
                    r -= 1
        else:
            r -= 1
 
print(ans)
### BUGGY CODE ###

from math import gcd

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

def createPrimeList(N, isTable=True):
    isPrime = [True] * (N + 1)
    isPrime[0] = False
    isPrime[1] = False
    for i in range(2, N + 1):
        if not isPrime[i]:
            continue
        for p in range(i * 2, N, i):
            isPrime[p] = False
    return isPrime if isTable else [i for i in range(2, N) if isPrime[i]]

from collections import Counter
primeList = createPrimeList(10**5, False)
def primeFactorization2(N):
    primes = Counter()
    for p in primeList:
        while N % p == 0:
            N //= p
            primes[p] += 1
    return primes

def isSetwise(A):
    ret = A[0]
    for a in A:
        ret = gcd(ret, a)
    return ret == 1

def isPairwise(A):
    prd = Counter()
    for a in A:
        ps = primeFactorization2(a)
        for p, c in ps.items():
            if prd[p] >= 1:
                return False
            prd[p] += c
    return True

if not isSetwise(A):
    print('not coprime')
    exit()

if isPairwise(A):
    print('pairwise coprime')
else:
    print('setwise coprime')


### FIXED CODE ###

from math import gcd

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

def isSetwise(A):
    ret = A[0]
    for a in A:
        ret = gcd(ret, a)
    return ret == 1
from collections import Counter

def createPrimeList(N):
    isPrime = [True] * (N + 1)
    isPrime[0] = False
    isPrime[1] = False
    smallestPrime = [1] * (N + 1)
    for i in range(2, N + 1):
        if not isPrime[i]:
            continue
        for p in range(i * 2, N, i):
            if isPrime[p]:
                smallestPrime[p] = i
            isPrime[p] = False
    return smallestPrime

from collections import Counter
smallestPrime = createPrimeList(max(A) + 10)
def primeFactorization(N):
    ret = Counter()
    while N > 1:
        p = smallestPrime[N]
        if p == 1:
            ret[N] += 1
            break
        ret[p] += 1
        N //= p
    return ret

def isPairwise(A):
    P = Counter()
    for a in A:
        for p in primeFactorization(a):
            if P[p] >= 1:
                return False
            P[p] += 1
    return True

if not isSetwise(A):
    print('not coprime')
    exit()

if isPairwise(A):
    print('pairwise coprime')
else:
    print('setwise coprime')
### BUGGY CODE ###

N = int(input())
A = list(map(int, input().split()))
ans = 0
for i in range(N-1):
  for j in range(i+1, N):
    number = abs(i-j)
    tall = A[i]+A[j]
    if number == tall:
      ans += 1
      
print(ans)

### FIXED CODE ###

from collections import defaultdict
 
n = int(input())
a = list(map(int, input().split()))
ap = defaultdict(int)
for i in range(n):
    ap[i - a[i]] += 1

ans= 0
for i in range(n):
    ans += ap[a[i] + i]
print(ans)
### BUGGY CODE ###

from collections import deque
import math
import copy
import sys
sys.setrecursionlimit(2147483647)

h,w = map(int, input().split())
maze = [list(map(str,input())) for _ in range(h)]


ans = 0

for i in range(w):
     for j in range(h):
          for k in range(w):
               for l in range(h):

                    maze2 = copy.deepcopy(maze)

                    if maze[j][i] == '#' or maze[l][k] == '#':
                         pass
                    else:
                         sx,sy,gx,gy = i,j,k,l
                         for y in range(h):
                              for x in range(w):
                                   if maze[y][x] == '.':
                                        maze2[y][x] = 100000


                         maze2[sy][sx]=0
                         que=deque([[sy,sx]])
                         while que:
                              y,x=que.popleft()
                              for m,n in [(1,0),(0,1),(-1,0),(0,-1)]:
                                   nexty,nextx=y+m,x+n
                                   if  nexty in range(h) and nextx in range(w):
                                        dist=maze2[nexty][nextx]
                                        if dist!='#':
                                             if dist>maze2[y][x]+1:
                                                  maze2[nexty][nextx]=maze2[y][x]+1
                                                  que.append([nexty,nextx])
                         if ans < maze2[gy][gx]:
                              ans = maze2[gy][gx]

print(ans)

### FIXED CODE ###

h,w = map(int,input().split())
s = [0] * h
for i in range(h):
    s[i] = str(input())

def warshall_floyd(d):
    #d[i][j]: iからjへの最短距離
    for k in range(w*h):
        for i in range(w*h):
            for j in range(w*h):
                d[i][j] = min(d[i][j],d[i][k] + d[k][j])
    return d


d = [[float("inf")] * (h * w) for i in range((h * w))]
#d[u][v] : 辺uvのコスト(存在しないときはinf)
for i in range(h):
    for j in range(w):
        if s[i][j] == '.':
            a = i * w + j
            d[a][a] = 0
            for m, n in [(1, 0), (0, 1), (-1, 0), (0, -1)]:
                ss = i + m
                t = j + n
                if 0 <= ss <= h-1 and 0 <= t <= w-1 and s[ss][t] == '.':
                    b = ss * w + t
                    d[a][b] = 1
                    d[b][a] = 1
     #自身のところに行くコストは０
ans = 0
box = warshall_floyd(d)
for i in range(h * w):
    for j in range(h*w):
        if box[j][i] > 1000000:
            box[j][i] = 0
        ans = max(ans,box[j][i])

print(ans)
### BUGGY CODE ###

def f(s):
    rd = [[10, 11, 12], [3, 6, 9], [4, 8, 12], [1, 2, 3], [4, 7, 10], [1, 5, 9]]
    k = len(s)
    md = 10 ** 9 + 7
    dp = [[0] * 13 for _ in range(k + 1)]
    dp[0][0] = 1
    dpi = dp[0]
    for i, c in enumerate(s[::-1]):
        dpi1 = dp[i + 1]
        if c == "?":
            r1, r2, r3 = rd[i % 6]
            sm = sum(dpi)
            for j in range(13):
                dpi1[j] = (sm - (dpi[j - r1] + dpi[j - r2] + dpi[j - r3])) % md
        else:
            m = int(c) * 10 ** i % 13
            for j in range(13):
                dpi1[j] = (dpi1[j] + dpi[j - m]) % md
        dpi = dpi1
    print(dp[k][5])

s = input()
f(s)


### FIXED CODE ###

import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

class mint:
    def __init__(self, x):
        self.__x = x % md

    def __str__(self):
        return str(self.__x)

    def __add__(self, other):
        if isinstance(other, mint): other = other.__x
        return mint(self.__x + other)

    def __sub__(self, other):
        if isinstance(other, mint): other = other.__x
        return mint(self.__x - other)

    def __rsub__(self, other):
        return mint(other - self.__x)

    def __mul__(self, other):
        if isinstance(other, mint): other = other.__x
        return mint(self.__x * other)

    __radd__ = __add__
    __rmul__ = __mul__

    def __truediv__(self, other):
        if isinstance(other, mint): other = other.__x
        return mint(self.__x * pow(other, md - 2, md))

    def __rtruediv__(self, other):
        return mint(other * pow(self.__x, md - 2, md))

    def __pow__(self, power, modulo=None):
        return mint(pow(self.__x, power, md))

md = 10 ** 9 + 7

def main():
    s = SI()
    n = len(s)
    dp = [[0] * 13 for _ in range(n + 1)]
    # dp[i][m]...iケタ目までみたときに、余りがmになる数の個数
    dp[0][0] = mint(1)
    e10 = 1
    for i, c in enumerate(s[::-1]):
        for m in range(13):
            pre = dp[i][m]
            if pre == 0: continue
            if c == "?":
                for d in range(10):
                    nm = (m + d * e10) % 13
                    dp[i + 1][nm] += pre
            else:
                nm = (m + int(c) * e10) % 13
                dp[i + 1][nm] += pre
        e10 = e10 * 10 % 13
    print(dp[n][5])

main()
### BUGGY CODE ###

n = int(input())
s = [int(input()) for i in range(n)]
ans=0
for i in range(2**len(s)):
    x=0
    for j in range(n):
        if (i>>j)&1:
            x+=s[j]
    if x%10!=0:
        ans=max(ans,x)
print(ans)

### FIXED CODE ###

n = int(input())
s = [int(input()) for i in range(n)]
ans=0
m = sum(s)
if m%10==0:
    f = True
    s.sort()
    for si in s:
        if si%10!=0:
            print(m-si)
            f = False
            break
    if f:
        print(0)
else:
    print(m)
### BUGGY CODE ###

a,b = map(int,input().split())
maximum_num = max(a,b)
flag = 1
def equal_divide(x):
    equal = 1
    if x%a==0:
        if x%b==0:
            equal=0
    return equal

while (flag):
    flag = equal_divide(maximum_num)
    maximum_num+=1
print(maximum_num-1)



### FIXED CODE ###

import fractions
a,b = map(int,input().split())
ans = a*b/fractions.gcd(a,b)
print(int(ans))

#LCM = X*Y/GCD
#LCM = 最小公倍数
#GCD = 最大公約数
### BUGGY CODE ###

a, b, c, k = map(int, input().split())

cnt = 0

if a <= k:
    cnt = cnt + 1*a #1
    k = k - a #3
elif a > k:
    for i in range(0, k):
        cnt += 1
        k -= 1

if b <= k:
    k = k - b #1
elif b > k:
    for i in range(0, k):
        k -= 1

if c <= k:
    cnt = cnt + -1*c
    k = k - c
elif c > k:
    for i in range(0, k):
        cnt += -1
        k -= 1

print(cnt)

### FIXED CODE ###

a, b, c, k = map(int, input().split())

cnt = 0

if k >= a:
    k = k - a #3
    cnt = cnt + 1*a  #1

    if k >= b:
        k = k - b #1

        if k >= c:
            cnt = cnt + -1*c
            k = k - c

        else:
            cnt = cnt + -1*k
            k = k - k
    
    else:
        k = k - k

else:
    cnt = cnt + 1*k
    k = k - k
    
print(cnt)
### BUGGY CODE ###

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

# aを2進数化
# 2 ** 29 < 10 ** 9 < 2 ** 30
k = 30 # 2進数変換後の最大桁数
a_binary = [[0] * k for _ in range(N)]
for i in range(N):
  quotient = a[i]
  remainder = 0
  for j in range(k):
    remainder = quotient % 2
    quotient = quotient // 2
    a_binary[i][j] = remainder
s = [0] * k # a1 xor a2 xor ~ xor aN
for i in range(k):
  count_1 = 0
  for j in range(N):
    if a_binary[j][i] == 1:
      count_1 += 1
  if count_1 % 2 == 1:
    # 1が奇数個の場合
    s[i] = 1
  else:
    s[i] = 0
x_binary = [[0] * k for _ in range(N)]
for i in range(N):
  for j in range(k):
    if a_binary[i][j] + s[j] == 1:
      x_binary[i][j] = 1
    else:
      x_binary[i][j] = 0
x_str = ""
for i in range(N):
  xi = 0
  for j in range(k):
    t = 2 ** j
    xi += x_binary[i][j] * t
  x_str += str(xi)
  if i != N-1:
    x_str += " "

print(x_str)

### FIXED CODE ###

# -*- coding: utf-8 -*-
N = int(input())
A = list(map(int, input().split()))
s = 0
for a in A:
  s ^= a
ans = list()
for a in A:
  ans.append(s ^ a)
print(" ".join(map(str, ans)))
### BUGGY CODE ###

import sys
sys.setrecursionlimit(10 ** 5 + 10)
def input(): return sys.stdin.readline().strip()

def resolve():
    S=int(input())
    SS=str(S)
    ls=len(SS)
    cnt=0
    for i in range(ls-3):
        for j in range(i+4,ls+1):
            if int(SS[i:j])%2019==0:
                cnt+=1
    print(cnt)


resolve()

### FIXED CODE ###

import sys

sys.setrecursionlimit(10 ** 5 + 10)


def input(): return sys.stdin.readline().strip()


def resolve():
    S = str(input())
    N=len(S)
    P=2019

    def main():
        if P == 2:
            res = 0
            for i in range(N):
                if int(S[N - 1 - i]) % 2 == 0:
                    res += N - i
        elif P == 5:
            res = 0
            for i in range(N):
                if int(S[N - 1 - i]) == 0 or int(S[N - 1 - i]) == 5:
                    res += N - i

        else:
            mods = [0] * P
            # mods[i]はPで割ったあまりがiである連続部分列の個数
            tenfactor = 1
            mod = 0
            mods[mod] += 1

            for i in range(N):
                mod = (mod + int(S[N - i - 1]) * tenfactor) % P
                tenfactor = (tenfactor * 10) % P
                mods[mod] += 1

            res = 0
            for p in range(P):
                res += mods[p] * (mods[p] - 1) // 2

        return res

    print(main())


resolve()
### BUGGY CODE ###

S = list(input())
u = 10**9+7
d = len(S)
dp = [0]*13
dp[0] = 1
m = 1

for i in range(d-1,-1,-1):
    tmp = [0]*13
    a = S[i]
    if a=='?':
        for j in range(10):
            c = j*m
            for k in range(13):
                n = (c+k)%13
                tmp[n] += dp[k]
                tmp[n] %= u
    else:
        c = int(a)*m
        for k in range(13):
            n = (c+k)%13
            tmp[n] += dp[k]
            tmp[n] %= u
    m *= 10
    m %= 13
    dp = tmp
print(dp[5])

### FIXED CODE ###

import sys
def input():
    return sys.stdin.readline()[:-1]
S = list(input())
u = 10**9+7
d = len(S)
dp = [0]*13
dp[0] = 1
m = 1

for i in range(d-1,-1,-1):
    tmp = [0]*13
    a = S[i]
    if a=='?':
        for j in range(10):
            c = j*m
            for k in range(13):
                n = (c+k)%13
                tmp[n] += dp[k]
                tmp[n] %= u
    else:
        c = int(a)*m
        for k in range(13):
            n = (c+k)%13
            tmp[n] += dp[k]
            tmp[n] %= u
    m *= 10
    m %= 13
    dp = tmp
print(dp[5])
### BUGGY CODE ###

import sys
input = sys.stdin.readline

k,q=map(int,input().split())
D=list(map(int,input().split()))


for query in range(q):
    n,x,m=map(int,input().split())

    D2=[d%m for d in  D]
    S=sum(D2)
    D0=D2.count(0)
    R=(n-1)//k
    ANS=R*(k-D0) - (R*S+x%m)//m 

    x2=(x+S*R)%m

    for i in range(n-R*k-1):
        nx=(x2+D[i])%m

        if nx>x2:
            ANS+=1
        x2=nx

    print(ANS)

### FIXED CODE ###

import sys
input = sys.stdin.readline

k,q=map(int,input().split())
D=tuple(map(int,input().split()))

def sum_count(A):
    S=0
    C=0
    for a in A:
        if a==0:
            C+=1
        else:
            S+=a
    return S,C

for query in range(q):
    n,x,m=map(int,input().split())

    D2=[d%m for d in  D]
    S,D0=sum_count(D2)
    R=(n-1)//k
    ANS=R*(k-D0) - (R*S+x%m)//m 
    x2=(x+S*R)%m
    rest=n-R*k-1
    S2,DR0=sum_count(D2[:rest])
    ANSR=rest - DR0 - (x2+S2)//m

    print(ANS+ANSR)
### BUGGY CODE ###

n = int(input())
a = input().rstrip().split(" ")
i = 0
j = 0
ans = []

for i in range(int(n)):
    for j in range(int(n)):
        if int(i) + 1 == int(a[j]):
            ans.append(int(j) + 1)
            
for k in range(int(n)):
    print(ans[k] , end = " ")

### FIXED CODE ###

n = int(input())
a = list(map(int,input().split()))
b = [0] * n

for i in range(n):
    b[a[i] - 1] = i + 1
    
for i in range(n):
    print(b[i],end=" ")
### BUGGY CODE ###

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

sum = 0
for i in range(A, B+1):
    sum = sum ^ i

print(sum)


### FIXED CODE ###

def F0_N(N):
  if N % 4 == 0:
  	return N
  elif N % 4 == 1:
    return 1
  elif N % 4 == 2:
     return N + 1
  elif N % 4 == 3:
     return 0

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

print(F0_N(A-1) ^ F0_N(B))
### BUGGY CODE ###

L,R = map(int,input().split())
#divisor = [2019,673,3]
x = 2019
X = []
if L-R >= 2019:
    x=0
else:
    for i in range(L,R):
        for j in range(i+1,R+1):
            #x = min(x,(i%2019)*(j%2019))
            X.append((i*j)%2019)
x = min(X)
print(x)

### FIXED CODE ###

L,R = map(int,input().split())
 
x = 2019**2
for i in range(L, R):
    for r in range(i+1, R+1):
        ans = (i*r) % 2019 
        if x > ans:
            x = ans
            if x == 0:
        	    break
    if x == 0:
      break
print(x)
### BUGGY CODE ###

# -*- coding: utf-8 -*-
"""
Created on Sun Apr 26 20:57:47 2020
"""

import sys
#import numpy as np

sys.setrecursionlimit(10 ** 9)
#def input():
#    return sys.stdin.readline()[:-1]
mod = 10**9+7

x = 2019
S = input()
l = len(S)
S = int(S)

a, b = [],[0]
s = 0
for i in range(l):
    s = (S%10**(i+1))
    b.append(s % x)

ans = 0

xx = [0 for _ in range(2019)]
for i in range(len(b)):
    xx[b[i]] += 1

def a(n):
    return n*(n+1)//2 

for i in range(len(xx)):
    if xx[i] > 1:
        ans += a(xx[i] - 1)

print(ans)


### FIXED CODE ###

# -*- coding: utf-8 -*-
"""
Created on Sun Apr 26 20:57:47 2020
"""

import sys
#import numpy as np

sys.setrecursionlimit(10 ** 9)
#def input():
#    return sys.stdin.readline()[:-1]
mod = 2019

S = input()
l = len(S)
#S = int(S)

a, b = [],[0]
s = 0
xx = [0 for _ in range(2019)]
xx[0] += 1
for i in range(l):
    s += int(S[-i-1])*pow(10,i,mod)
    s %= mod
#    b.append(s % x)
    xx[s] += 1

ans = 0
#for i in range(len(b)):
#    xx[b[i]] += 1
def a(n):
    return n*(n+1)//2 

for i in range(len(xx)):
    if xx[i] > 1:
        ans += a(xx[i] - 1)

print(ans)
### BUGGY CODE ###

N = int(input())
A = [int(v) for v in input().split()]
count = 0
for i in range(len(A)-1):
  for j in range(i+1,len(A)):
    a1,a2 = A[i],A[j]
    diff = j-i
    if diff == a1+a2:
      count += 1
print(count)

### FIXED CODE ###

N = int(input())
A = [int(v) for v in input().split()]
L, R = {}, {}
for i,a in enumerate(A):
  l,r = i+a,i-a
  if l not in L: L[l]=0
  if r not in R: R[r]=0
  L[l]+=1
  R[r]+=1

count = 0
for X in L:
  if X not in R: continue
  count += L[X]*R[X]
print(count)