Problem:
Remainder of Big Integers Given two integers $A$ and $B$, compute the remainder of $\frac{A}{B}$. Input Two integers $A$ and $B$ separated by a space character are given in a line. Output Print the remainder in a line. Constraints  $0 \leq A, B \leq 10^{1000}$  $B \ne 0$  Sample Input 1 5 8 Sample Output 1 5 Sample Input 2 100 25 Sample Output 2 0

Solution (Python):
def main():
   a,b = map(int, input().split())
   print(a%b)


main()

Solution (Python):
import sys
a,b=map(int,sys.stdin.readline().split())
print(a%b)

Solution (Python):
a,b=map(int, input().split())
print(a%b)

Solution (Python):
a, b = map(int, input().split())
print(a % b)

Solution (Python):
a, b = map(int,input().split())
print(a%b)

Solution (Python):
a, b = [int(i) for i in input().split()]
print(a % b)

Solution (Python):
a,b = map(int,input().split())
print(a%b)

Solution (Python):
a, b = map(int, input().split())
print(a % b)

Solution (Python):
a,b=map(int,input().split())
print(a%b)

Solution (Python):
a, b = map(int, input().split())
print(a % b)

Solution (Python):
a, b = map(int, input().split())
print(a % b)

Solution (Python):
a,b = map(int,input().split())
print(a % b)

Solution (Python):
a, b=input().split(' ')
a=int(a)
b=int(b)

print(a-a//b*b)

Solution (Python):
a, b = map(int, input().split())
print(a % b)

Solution (Python):
a, b = map(int,input().split())
print(a%b)

Solution (Python):
a, b = map(int, input().split())
print(a%b)

Solution (Python):
a, b = map(int, input().split())
print(a % b)

Solution (Python):
a,b = map(int,input().split())
print(a%b)

Solution (Python):
print(eval(input().replace(" ","%")))

Solution (Python):

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


print(a % b)

Solution (Python):
a,b=map(int, input().split())
print(a%b)

Solution (Python):
a, b = map(int, input().split())
print(a % b)

Solution (Python):
import sys,bisect,math
from functools import reduce
sys.setrecursionlimit(15000)

import sys,bisect,math
A,B = map(int,sys.stdin.readline().split())
res = A%B
print(res)

Solution (Python):
a,b=map(int,input().split())
print(a%b)

Solution (Python):
a, b = map(int, input().split())
print(a % b)

Solution (Python):
a,b=map(int,input().split())
ans=a%b
print(ans)

Solution (Python):
a,b = map(int,input().split())
print(a%b)

Solution (Python):
import math
n, m = map(int, input().split())
print(n % m)

Solution (Python):
a,b = map(int,input().split())
print(a%b)

Solution (Python):
a, b = map(int, input().split())
print(a%b)

Solution (Python):
a,b = map(int,input().split())
print(a%b)

Solution (Python):
a,b = map(int,input().split())
print(a%b)

Solution (Python):
x = input()
a, b = x.split()
a = int(a)
b = int(b)
print(a % b)

Solution (Python):
s = input().split()
a = int(s[0])
b = int(s[1])
print(a % b)

Solution (Python):
A,B = map(int,input().split())
print(A % B)

Solution (Python):
a,b = map(int,input().split())
print(a%b)

Solution (Python):
a,b=map(int,input().split())
print(a%b)

Solution (Python):
a,b = map(int,input().split())
print(a%b)

Solution (Python):
a,b=map(int,input().split())

print(a%b)

Solution (Python):
A,B=[int(i) for i in input().split(" ")]
print(A%B)

Solution (Python):
a,b = map(int,input().split())

print(a%b)

Solution (Python):
a, b = map(int, input().split())
print(a % b)

Solution (Python):
A, B = map(int, input().split())
print(A % B)

Solution (Python):
a,b = map(int,input().split())
print(a%b)

Solution (Python):
a = [int (i) for i in input().split()];
print (a[0] % a[1]);

Solution (Python):
a,b = map(int,input().split())

print(a%b)

Solution (Python):
(x,y)=map(int,input().split(' '))
print(x%y);

Solution (Python):
a = map(long,raw_input().split(' '))
print a[0] % a[1]

Solution (Python):
a,b=map(int,input().split())
print(a%b)

Solution (Python):
a, b = map(int, input().split())
print(a % b)

Solution (Python):
a, b = map(int,input().split())
print(a % b)

Solution (Python):

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

print(a % b)

Solution (Python):
a,b = map(int,input().split())
print(a%b)

Solution (Python):
def main():
    A, B = map(int, input().split())
    print(A%B)

if __name__ == '__main__':
    main()

Solution (Python):
a, b = map(int, input().split())
print(a % b)

Solution (Python):
a,b = [int(x) for x in input().split()]

print(a%b)

Solution (Python):
print(eval(input().replace(" ","%")))

Solution (Python):
a, b = map(int, input().split())
print(a % b)

Solution (Python):


from collections import Counter,deque


from sys import stdin,setrecursionlimit


setrecursionlimit(10**6)
input=stdin.readline

a,b=map(int,input().split())
print(a%b)

Solution (Python):
import sys

a,b=list(map(int,input().split()))
print(a%b)

Solution (Python):
if __name__ == "__main__":
    a, b = list(map(lambda x: int(x), input().split()))
    print(a % b)

Solution (Python):
a,b=map(int,input().split() )
print(a%b)

Solution (Python):
a, b = input().split()
print(int(a) % int(b))

Solution (Python):
a, b = map(int, input().split())
print(a % b)

Solution (Python):

from collections import defaultdict,deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S(): return list(sys.stdin.readline())[:-1]
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

"""
import math

n = int(input())
m = n
ans = []
i = 2
k = math.sqrt(n)
while i <= k:
    if n%i == 0:
        n = n//i
        ans.append(i)
        i -= 1
        if n == 1:
            break
    i += 1
if len(ans) == 0 or n != 1:
    ans.append(n)
print(m,end = ": ")
for i in range(len(ans)-1):
    print(ans[i], end = " ")
print(ans[-1])
"""


"""
m,n = map(int, input().split())
b = bin(n)[2:]
num = [m]
for i in range(len(b)-1):
    num.append(num[-1]**2%1000000007)
ans = 1
for i in range(len(b)):
    ans *= num[i] if b[len(b)-1-i] == "1" else 1
    ans %= 1000000007
print(ans)
"""


"""
import math

l = int(input())
a = list(map(int, input().split()))
dict = {}
for n in a:
    ans = []
    i = 2
    k = math.sqrt(n)
    dic = {}
    while i <= k:
        if n%i == 0:
            n = n//i
            ans.append(i)
            i -= 1
            if n == 1:
                break
        i += 1
    if len(ans) == 0 or n != 1:
        ans.append(n)
    for i in ans:
        if i in dic:
            dic[i] += 1
        else:
            dic[i] = 1
    for i in dic.keys():
        if i in dict:
            dict[i] = max(dict[i], dic[i])
        else:
            dict[i] = dic[i]
sum = 1
for x,y in dict.items():
    sum *= x**y
print(sum)
"""


"""
import math

n = int(input())
m = n
ans = []
i = 2
k = math.sqrt(n)
dic = {}
while i <= k:
    if n%i == 0:
        n = n//i
        ans.append(i)
        i -= 1
        if n == 1:
            break
    i += 1
if len(ans) == 0 or n != 1:
    ans.append(n)
ans = list(set(ans))
sum = m
for i in ans:
    sum *= (1-1/i)
print(int(sum))
"""


"""
def gcd(a,b):
    if a==0:
        return b
    return gcd(b%a,a)
a,b = LI()
g = gcd(a,b)
a//=g
b//=g
if b == 1:
    print(0,1)
    quit()
if b < 4:
    f = b-1
else:
    p = []
    x = 2
    m = b
    while x**2 <= b:
        if not m%x:
            p.append(x)
            while not m%x:
                m//=x
        x += 1
    if m != 1:p.append(m)
    f = b
    for i in p:
        f *= (1-1/i)
    f = int(f)
x_ = pow(a,f-1,b)
y_ = (1-a*x_)//b
ans = [x_,y_,abs(x_)+abs(y_)]
for i in range(-10000,10000):
    s = -b*i+x_
    t = a*i+y_
    m = abs(s)+abs(t)
    if m < ans[2]:
        ans = [s,t,m]
    elif m == ans[2] and s <= t:
        ans = [s,t,m]
print(ans[0],ans[1])
"""



"""
a,b = LI()
print(a+b)
"""


"""
a,b = LI()
print(a-b)
"""


"""
a,b = LI()
print(a*b)
"""


"""
a,b = LI()
if a*b < 0:
    print(-(-a//b))
else:
    print(a//b)
"""


a,b = LI()
print(a%b)

Solution (Python):
a, b = map(int, input().split())
print(a % b)

Solution (Python):

"""
Big Integers - Remainder of Big Integers
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=NTL_2_E&lang=jp

"""
import sys


def main(args):
    A, B = map(int, input().split())
    print(A % B)


if __name__ == '__main__':
    main(sys.argv[1:])

Solution (Python):
a,b=map(int, input().split())
print(a%b)

Solution (Python):
a = input().split()
print(int(a[0]) % int(a[1]))

Solution (Python):
A, B = map(int, input().split())
print(A % B)

Solution (Python):
A, B = map(int, input().split())


print(A % B)

Solution (Python):
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
Max = sys.maxsize
def l(): 
	return list(map(int,input().split()))
def m(): 
	return map(int,input().split())
def onem(): 
	return int(input())
def s(x): 
	a = []
	aa = x[0]
	su = 1
	for i in range(len(x)-1):
		if aa == x[i+1]:
			a.append([aa,su])
			aa = x[i+1]
			su = 1
		else:
			su += 1
	a.append([aa,su])
	return a
def jo(x): 
	return " ".join(map(str,x))
def max2(x): 
	return max(map(max,x))

n,m= m()

print(n%m)

Solution (Python):
a, b = map(int, input().split())
print(a % b)

Solution (Python):
A,B=map(int,input().split())
print(A%B)

Solution (Python):
a, b = map(int, input().split())
print(a%b)

Solution (Python):
A, B = map(int, input().split())

print(A % B)

Solution (Python):
A, B = map(int, input().split())
print(A % B)

Solution (Python):
A, B = map(int, raw_input().split())
print A % B

Solution (Python):
a,b = map(int,input().split())
print(a % b)

Solution (Python):
print(eval(input().replace(' ','%')))

Solution (Python):
x,y = list(map(int, input().split()))
print(x%y)

Solution (Python):
a,b=map(int,input().split())
print(a%b)

Solution (Python):
from decimal import *

a, b = input().rstrip().split(' ')

getcontext().prec = len(a)

ans = Decimal(a) % Decimal(b)
ans = ans.quantize(Decimal('1.'), rounding=ROUND_DOWN)
if ans == 0:
    print(0)
else:
    print(ans)

Solution (Python):
A, B = map(int, input().split())
print(A % B)

Solution (Python):
a,b=map(int, input().split())
print(a%b)

Solution (Python):
a,b=input().split(" ")
a=int(a)
b=int(b)
print(a%b)