Problem:
 Score : 100 points    Problem Statement Takahashi is distributing N balls to K persons.  If each person has to receive at least one ball, what is the maximum possible difference in the number of balls received between the person with the most balls and the person with the fewest balls?      Constraints  1 \leq K \leq N \leq 100  All values in input are integers.         Input Input is given from Standard Input in the following format:  N  K       Output Print the maximum possible difference in the number of balls received.        Sample Input 1 3 2      Sample Output 1 1  The only way to distribute three balls to two persons so that each of them receives at least one ball is to give one ball to one person and give two balls to the other person.  Thus, the maximum possible difference in the number of balls received is 1 .       Sample Input 2 3 1      Sample Output 2 0  We have no choice but to give three balls to the only person, in which case the difference in the number of balls received is 0 .       Sample Input 3 8 5      Sample Output 3 3  For example, if we give 1, 4, 1, 1, 1 balls to the five persons, the number of balls received between the person with the most balls and the person with the fewest balls would be 3 , which is the maximum result.

Solution (Python):
n, k = map(int, input().split())
if k == 1:
    print(0)
else:
    print(n - k)

Solution (Python):
n, k = map(int, input().split())

print(0 if n%k == 0 else n%k)

Solution (Python):
N, K=map(int, input().split())
if K==1:
  print(0)
else:
  print(N-K)

Solution (Python):
def main():
    N,K = map(int,input().split())
    print(N-(N//K)*K)
if __name__ == '__main__':
    main()

Solution (Python):
N, K = map(int, input().split())

if K == 1:
    print(0)
else:
    print(N - K)

Solution (Python):
from sys import stdin
import string

n,k = [int(x) for x in stdin.readline().rstrip().split()]

if k == 1:
    print(0)
    exit()
print(n-k)

Solution (Python):
n, k = map(int, input().split())

if n // k <= 0:
    print(0)
elif k == 1:
    print(0)
else:
    max_num = n - k + 1
    print(max_num - 1)

Solution (Python):
n,k = map(int,input().split())
if k == 1:
  print(0)
else:
  print(n-k)

Solution (Python):
n, k = map(int,input().split())

print(n-k if k != 1 else 0)

Solution (Python):
n, k = map(int, input().split())
if k == 1:
    print(0)
else:
    print(n - k)

Solution (Python):

 
import math
import itertools
import sys
import copy
 





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

if K == 1 :
  print (0)
else :
  print (N-(K-1)-1)

Solution (Python):
n, k = map(int, input().split())

if k == 1:
	print(0)
else:
	print(n - k)

Solution (Python):
n,k = map(int,input().split())

if k == 1:
   print(0)
else:
   g = n - (k - 1)
   if g == 1:
      print(0)
   elif g < 1:
      print(1)
   else:
      print(g-1)

Solution (Python):
N,K=map(int,input().split())
if K==1:
    print(0)
else:
    print(N-K)

Solution (Python):
n,k=map(int,input().split())

if k==1:
	print(0)
	exit()

print(n-k)

Solution (Python):
a= list(map(int,input().split()))
N=a[0]
K=a[1]

if K==1:
    print(0)
else:
    print(N-K)

Solution (Python):
N, K = map(int,input().split())
print(N-K if K != 1 else 0)

Solution (Python):
n,k=map(int,input().split())
ans=n-k
if k==1:
  ans=0
print(ans)

Solution (Python):
N,K = map(int,input().split())
if K == 1:
  print(0)
else:
  print(N-K)

Solution (Python):
n,k=map(int,input().split())

if k==1:
	ans=0
else:
	ans=n-k
print(ans)

Solution (Python):
N,K = map(int,input().split())
if K != 1:
    print(N-K)
else:
    print(0)

Solution (Python):
n,k=map(int,input().split())
print(n%k)

Solution (Python):
N, K = map(int, input().split())
if K == 1:
    print(0)
else:
    print(N - K)

Solution (Python):
n, k = [int(i) for i in input().split(" ")]

print(n - k if k != 1 else 0)

Solution (Python):
def examA():
    N, K = LI()
    if K==1:
        ans = 0
    else:
        ans = N-K
    print(ans)


from string import digits
import sys,copy,bisect,itertools,math
from heapq import heappop,heappush,heapify
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 SI(): return sys.stdin.readline().strip()
mod = 10**9 + 7
inf = float('inf')

examA()

Solution (Python):
N,K = map(int,input().split())
print(N-K if K!=1 else 0)

Solution (Python):
N,K = map(int,input().split())


if  K == 1:
  print(0)
  
else:
  print(N - K)

Solution (Python):
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n, k = list(map(int, readline().split()))
    if k == 1:
        print(0)
    elif n < k:
        print(1)
    else:
        print(n - k)


if __name__ == '__main__':
    solve()

Solution (Python):
n,k=map(int,input().split())
if k>1:
  print(n-k)
else:
  print(0)

Solution (Python):
n,k=map(int,input().split())
if k==1:
  print(0)
else:
  print(n-k)

Solution (Python):
N, K = map(int, input().split())
if K == 1: print(0)
else: print(N - K)

Solution (Python):
N,K = map(int,input().split())
if K == 1:
    print(0)
else:
    print(N-K)

Solution (Python):
def main(n: int, k: int):
    if k == 1:
        print(0)
        return

    print(n - k)


if __name__ == "__main__":
    n, k = map(int, input().split())

    main(n, k)

Solution (Python):
N,K=map(int,input().split())
print(0 if K==1 else N-K)

Solution (Python):
N,K = (int(i) for i in input().split())

if K == 1:
    ans = 0
else:
    ans = N - K
print(ans)

Solution (Python):
n,k=map(int,input().split())
print((n-k)*(k!=1))

Solution (Python):
N, K = map(int, input().split())
if K == 1:
    print(0)
else:
    print(N - K)

Solution (Python):
def inpl():
    return list(map(int, input().split()))


N, K = inpl()
print(N - K if K > 1 else 0)

Solution (Python):


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

if k == 1:
  print(0)
else:
  print(n-k)

Solution (Python):
N,K = map(int, input().split())
print(N%K)

Solution (Python):
n,k=map(int,input().split())
if k==1:
  print(0)
else:
  print(n-k)

Solution (Python):
n,k = map(int,input().split())
if k == 1:
         print(0)
else:
         print(n-k)

Solution (Python):
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor
from functools import reduce


sys.setrecursionlimit(2147483647)
INF = 10 ** 18
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
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)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 998244353



n, k = LI()
if k == 1:
    print(0)
else:
    print(n - k)

Solution (Python):
n, k = map(int, input().split())
if k==1:
  print(0)
else:
  print(n-k)

Solution (Python):
n,k=map(int,input().split())
if k!=1:
  print(n-k)
else:
  print(0)

Solution (Python):
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

n,k = inpl()
if k == 1:
    print(0)
else:
    print(n-k)

Solution (Python):
N, K = map(int,input().split())
if K == 1:
    print(0)
else:
    print(N-K)

Solution (Python):

n, k = [int(s) for s in input().split()]
if k == 1:
    print(0)
else:
    print(n - k)

Solution (Python):
n,k=map(int,input().split())
print(0 if k==1 else n-k)

Solution (Python):
N,K=map(int,input().split())

if K==1:
  print(0)
else:
  print(N-K)

Solution (Python):
n,k = map(int,input().split())
if k == 1 or n - k <= 0:
    print(0)
elif n - k > 0:
    print(n - k)

Solution (Python):
N,K = map(int,input().split())
if K>1:
    print(N-K)
else:
    print(0)

Solution (Python):
n, k = map(int, input().split())

print(n-k if k != 1 else 0)

Solution (Python):
N, K = map(int, input().split())
if K == 1:
	print(0)
else:
	print(N-K)

Solution (Python):
N, K = map(int, input().split())
if K == 1:
  print(0)
else:
  print(N - K)

Solution (Python):
N, K = map(int,input().split())
if K == 1:
  print(0)
else:
  print(N - K)

Solution (Python):
n,k=map(int,input().split())
if(k!=1):
  print(n-k)
else:
  print(0)

Solution (Python):
N, K = map(int, input().split())
if K ==1:
  ans = 0
else:
  ans = N - K
print(ans)

Solution (Python):
n,k = map(int, input().split())
if k == 1:
    print(0)
else:
    print(n-k)

Solution (Python):
import sys
N, K = map(int, sys.stdin.readline().split())

if K == 1:
  print(0)
else:
  print(N-K)

Solution (Python):
def slove():
    import sys
    input = sys.stdin.readline
    n, k = list(map(int, input().rstrip('\n').split()))
    if k == 1:
        print(0)
    else:
        print(n - k)


if __name__ == '__main__':
    slove()

Solution (Python):
n, k = map(int, input().split())
if k == 1:
  print(0)
else:
  print(n-k)

Solution (Python):
n, k = map(int, input().split())
if k == 1:
  print(0)
else:
  print(n-k)

Solution (Python):
n , k = map(int , input().split())
if k == 1:
    print(0)
else:
    print(n - k)

Solution (Python):
n,k= map(int, input().split())
for i in range(21200000):
    i+=1
if k==1:
    print(0)
else:
    print(n-k)

Solution (Python):
n,k= map(int, input().split())
for i in range(14200000):
    i+=1
if k==1:
    print(0)
else:
    print(n-k)

Solution (Python):
n,k= map(int, input().split())
for i in range(7000000):
    i+=1
if k==1:
    print(0)
else:
    print(n-k)

Solution (Python):
n,k=map(int,input().split())
print(n%k)

Solution (Python):
n,k= map(int, input().split())
if k==1:
    print(0)
else:
    print(n-k)

Solution (Python):
def slove():
    import sys
    input = sys.stdin.readline
    n, k = list(map(int, input().rstrip('\n').split()))
    ls = [0] * k
    pos = 0
    for i in range(n):
        ls[pos] += 1
        if pos + 1 < k:
            pos += 1
    print(0 if len(ls) == 1 else ls[-1] - ls[0])


if __name__ == '__main__':
    slove()

Solution (Python):
N, K = map(int, input().strip().split())


if K == 1:
    print(0)
else:
    print(N - K)

Solution (Python):
N,K=list(map(int, input().split()))
if K==1:print(0)
else:print(N-K)

Solution (Python):
N, K = tuple(map(int, input().split()))
if K == 1:
    print(0)
else:
    print(N - (K - 1) - 1)

Solution (Python):
n,k=map(int,input().split())
if k==1:
  print(0)
else:
  print(n-k)

Solution (Python):
n,k = map(int, input().split())
ma = n//k + n%k
mi = n//k
print(ma -mi)

Solution (Python):
N,K=map(int,input().split())
ans=N-K if K!=1 else 0
print(ans)

Solution (Python):
def resolve():
    n, k = map(int, input().split())
    if k == 1:
        print(0)
    else:
        print(n - k)


if __name__ == "__main__":
    resolve()

Solution (Python):
N,K=map(int,input().split())
if K ==1:
  print(0)
else:
  print(N-K)

Solution (Python):
import sys
input = sys.stdin.readline
 
def main():
    N, K = map(int, input().split())
    if K==1:
        print(0)
    else:
        print(N-K)

if __name__ == '__main__':
    main()

Solution (Python):
n, k = map(int, input().split())
print(n%k)

Solution (Python):
n,k=map(int,input().split())
if k==1:
  print(0)
else:
  print(n-k)

Solution (Python):
n,k=map(int,input().split())
if k>1:
    print(n-k)
else:
    print(0)

Solution (Python):
N,K= [int(i) for i in input().split()]
print(N-K if K!=1 else 0 )

Solution (Python):

import os,re,sys,operator,math,heapq,string


from itertools import accumulate,combinations
from sys import stdin,setrecursionlimit


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

n,k=map(int,input().split())
print(n%k if n>=k else 0)

Solution (Python):
N,K=map(int,input().split())
if K==1:
    print(0)
else:
    print(N-K)

Solution (Python):
N, K = map(int, input().split())
if K == 1:
    print(0)
else:
    print(N - K)

Solution (Python):
N,K=map(int,input().split())
if K==1:
    print(0)
else:
    print(N-K)

Solution (Python):
n, k = map(int, input().split())
if k != 1:
  print(n - k)
  exit()
else :
  print(0)

Solution (Python):
n,k=map(int,input().split())
if k==1:
  print(0)
else:
  print(n-k)

Solution (Python):
n,k = map(int,input().split())
print(n-k) if k>1 else print(0)

Solution (Python):
n, k = (int(i) for i in input().split())
print(n-k if k != 1 else 0)

Solution (Python):



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




print(N % K)

Solution (Python):
n,k = map(int,input().split())
if k == 1:
    print(0)
else:
    print(n-k)

Solution (Python):
def main():

    N, K = map(int, input().split())
    if K == 1: return 0

    return N-K



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

Solution (Python):
N, K = map(int, input().split())
if K == 1:
    print(0)
else:
    print(N-K)

Solution (Python):
m = list(map(int,input().split()))

if m[1] == 1:
    print(0)
else:
    print( m[0] - m[1])

Solution (Python):
N, K = map(int, input().split())
if K==1:
  print(0)
else:
  print(N-K)

Solution (Python):
n, k = map(int, input().split())
print(0) if k == 1 else print(n-k)

Solution (Python):
n,k=map(int,input().split())
print(0 if k==1 else n-k)

Solution (Python):
import math, string, itertools, fractions, heapq, collections, re, array, bisect, copy, functools, random
import sys
from collections import deque, defaultdict, Counter; from heapq import heappush, heappop
from itertools import permutations, combinations, product, accumulate, groupby
from bisect import bisect_left, bisect_right, insort_left, insort_right
from operator import itemgetter as ig
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 20; INF = float("INF"); ans = 0; tmp = 0; cnt = 0; ansli = []; tmpli = []; candili = []; stillset = set()
eps = 1.0 / 10 ** 10; mod = 10 ** 9 + 7
dd = [(-1, 0), (0, 1), (1, 0), (0, -1)]; ddn = dd + [(-1, 1), (1, 1), (1, -1), (-1, -1)]; ddn9 = ddn + [(0, 0)]
"""for dx, dy in dd:
        nx = j + dx; ny = i + dy
            if 0 <= nx < w and 0 <= ny < h:"""
def wi(): return list(map(int, sys.stdin.readline().split()))
def wip(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def ws(): return sys.stdin.readline().split()
def i(): return int(sys.stdin.readline())
def s(): return input()
def s_list(): return list(input())
def hi(n): return [i() for _ in range(n)]
def hs(n): return [s() for _ in range(n)]
def mi(n): return [wi() for _ in range(n)]
def num_grid(n): return [[int(i) for i in sys.stdin.readline().split()[0]] for _ in range(n)]
def mip(n): return [wip() for _ in range(n)]
def ms(n): return [ws() for _ in range(n)]
def grid(n): return [s_list() for _ in range(n)]

n, k = wi()
if k == 1:
    print(0)
elif n - k == 0:
    print(0)
elif n - k < 0:
    print(1)
else:
    print(n - k)

Solution (Python):
N, K = map(int, input().split())
print(N-K if K != 1 else 0)

Solution (Python):
n,k=map(int,input().split())
if k>1:
  print(n-k)
else:
  print(0)

Solution (Python):
n,k = map(int,input().split())
if k == 1:
  print(0)
else:
  print(n-k)

Solution (Python):
import sys
input = sys.stdin.readline

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

if P == 1:
    print(0)
else:
    print(N - P)

Solution (Python):
n, k = map(int,input().split())
if k == 1:
    print(0)
    exit()
print(n-(k-1) - 1)

Solution (Python):
N, K = (int(i) for i in input().split())
a = N - K

if K == 1:
    print('0')
else:
    print(a)

Solution (Python):
n, k = map(int, input().split())
if k == 1:
    print(0)
else:
    print(max(0, n - k))

Solution (Python):
N,K=map(int,input().split())
if K==1:
    print(0)
    exit()
print(N-K)

Solution (Python):
N, K = [int(_) for _ in input().split()]

if K == 1:
    print(0)
else:
    print(N-K)

Solution (Python):
n, k = map(int, input().split(" "));
if (k == 1):
    print(0)
else:
    print(n-k)

Solution (Python):
n,k=map(int,input().split())
print(n%k)

Solution (Python):

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

N = S[0]
K = S[1]


if N % K == 0:
    print(0)
else:
    print(N-K)

Solution (Python):
a,b=map(int,input().split())
if b==1:
  print(0)
else:
  print(a-b)

Solution (Python):
n,k = map(int,input().split())

if k == 1:
    print(0)
else:
    print(n-k)

Solution (Python):
N,K=map(int,input().split())
if K!=1:
  ans=N-K
else:
  ans=0
print(ans)

Solution (Python):
N, K = map(int, input().split())

print(0 if K == 1 else N - K)

Solution (Python):
N, K = map(int, input().split())
if K == 1:
    print(0)
else:
    print(N - K)

Solution (Python):
import sys
s2nn = lambda s: [int(c) for c in s.split(' ')]
ss2nn = lambda ss: [int(s) for s in ss]
ss2nnn = lambda ss: [s2nn(s) for s in ss]
i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())
ii2ss = lambda n: [sys.stdin.readline().rstrip() for _ in range(n)]
ii2sss = lambda n: [list(sys.stdin.readline().rstrip()) for _ in range(n)]
ii2nn = lambda n: ss2nn(ii2ss(n))
ii2nnn = lambda n: ss2nnn(ii2ss(n))

def main():
    N, K = i2nn()
    if K == 1:
        print(0)
    else:
        print(N-K)

main()

Solution (Python):
x,y = input().split()
N = int(x)
K = int(y)
if K == 1:
  print(0)
else:
  print(N-K)

Solution (Python):

def main():
    n, k = map(int, input().rstrip().split())
    print(n % k)


if __name__ == "__main__":
    main()

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

Solution (Python):
n,k=map(int,input().split())
if k==1:
    print(0)
else:
    print(n-k)

Solution (Python):
def solve(n, k):
    return n - k if k > 1 else 0

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

Solution (Python):
N,K = map(int,input().split())
if K == 1:
    print("0")
else:
    print(N-K)

Solution (Python):
N,K = map(int,input().split())

if K < 2:
  print(0)
else:
  print(N-K)

Solution (Python):
n, k = map(int,input().split())
if k==1:
	print(0)
else:
	print(n - k)

Solution (Python):
s=input().split()
n=int(s[0])
k=int(s[1])
if k ==1:
    print(0)
else:
    mx=n-k+1
    mn=1
    print(mx-mn)

Solution (Python):
N,K = map(int,input().split())

if K == 1:
    print(0)
else:
    print(N-K)

Solution (Python):
a,b = map(int,input().split(" "))
if b == 1:
    print(0)
else:
    print(a-b)

Solution (Python):
N, K = map(int, input().split())
if K == 1:
  print(0)
else:
  print(N-K)

Solution (Python):


import sys
import copy

sys.setrecursionlimit(1000000)





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

if K == 1:
    print(0)
else:
    print(N - K)

Solution (Python):
n, k = map(int, input().split())
print(n-k) if k != 1 else print(0)

Solution (Python):
N, K = map(int, input().split())


ans = (
    0 if K == 1 else
    N - K
)

print(ans)

Solution (Python):
N, K = [int(_) for _ in raw_input().split(" ")]
if K == 1:
  print 0
else:
  print (N - K)

Solution (Python):
n, k = map(int,input().split())


if k == 1:
    ans = 0
else:
    ans = (n-k+1)-1
print(ans)

Solution (Python):
N, K = map(int, input().split())
if K == 1:
    print(0)
else:
    print(N-K)

Solution (Python):
a, b = list(map(int,input().split()))
if b == 1:
  print(0)
  exit()
print(a-b)

Solution (Python):
N, K = map(int, input().split())
if K == 1:
	print(0)
else:
	print(N-K)

Solution (Python):
N,K=map(int,input().split())
ball = N - K
if K <= 1:
  print(0)
else:
  print(ball)

Solution (Python):
N,K = [int(x) for x in input().split()]
if(K==1):
  print(0)
else:
  print(N-K)

Solution (Python):
n,k = map(int, input().split())
if k == 1:
    print(0)
else:
    print(n-k)

Solution (Python):
N,K = map(int,input().split())
print(N % K)

Solution (Python):
n, k = map(int, input().split())
if k == 1 : print(0)
else : print(n - k)

Solution (Python):
n, k = map(int, input().split())
if k == 1:
    print(0)
else:
    print(n-k)

Solution (Python):
N,K = map(int,input().split())
if K == 1:
    print(0)
else:
    print(N - K)

Solution (Python):
a,b = map(int,input().split())
if b==1:
  print(0)
else:
  print(a-b)

Solution (Python):
N,K = map(int,input().split())
if K == 1 :
    print(0)
else:
    print(N-K)

Solution (Python):
N, K = map(int, input().split())

if K == 1:
    print(0)
else:
    print(N-K)

Solution (Python):
N, K = map(int, input().split())

if K == 1:
    print(0)
else:
    print(N-K)

Solution (Python):
N, K = map(int, input().split())
print(N - K if K != 1 else 0)

Solution (Python):
import sys
import math 
ni = lambda: int(ns())
na = lambda: list(map(int, input().split()))
ns = lambda: input()
N,K = na()


if K==1:
    print(0)
else:
    print(N-K)

Solution (Python):
n,k=map(int,input().split())
print(n-k+1-n//k)

Solution (Python):
import numpy as np

a = input().split(" ")
N = int(a[0])
K = int(a[1])

if K == 1:
    print(0)
else:
    print(N-K)

Solution (Python):
if __name__ == "__main__":
    n,k = input().split()
    n = int(n)
    k = int(k)
    if k == 1:
        print(0)
    else:
        print(n-k)

Solution (Python):
n, k = map(int, input().split())
if k == 1:
    print(0)
else:
    print(n - k)

Solution (Python):
N, K = map(int, input().split())
print(N % K)

Solution (Python):
N, K = map(int, input().split())

print(N-K if K > 1 else 0)

Solution (Python):
n,k = map(int, input().split())
if k == 1:
    print(0)
else:
    print(n-k)

Solution (Python):
N,K=map(int,input().split())
if K==1:
  print(0)
else:
  print(N-K)

Solution (Python):


N,K = [int(i) for i in input().split()]
if K > 1:
    print(N-K)
else:
    print(0)

Solution (Python):
N, K = map(int, input().split())
if K == 1:
    print(0)
else:
    print(N - K)

Solution (Python):
n, k = map(int,input().split(' '))
print ((k != 1) * (n-k))

Solution (Python):
N,K=map(int,input().split())

if K==1:
  print(0)
else:
  print(N-K)

Solution (Python):
N, K = map(int, input().split())

if K == 1:
	print(0)
else:
	print(N - K)

Solution (Python):
from sys import stdin
l = stdin.readline().rstrip().split()

n = int(l[0])
k=int(l[1])

if k == 1:
    print(0)
else:
    print(n-k)

Solution (Python):
(lambda n,k: print(0 if k==1 else n-k))(*list(map(int,input().split())))

Solution (Python):
n,k=map(int,input().split())
if k==1:
        print(0)
else:
        print(n-k)

Solution (Python):
N,K = map(int,input().split())
print((N-K+1) - (N//K))

Solution (Python):
n, k = [int(i) for i in input().split()]
if k == 1:
    print(0)
else:
    print(n-k)

Solution (Python):
N,M = map(int,input().split(' '))
if M == 1:
  print(0)
  exit()
else:
  print(N-M)

Solution (Python):
n,k=map(int,input().split())
print(n%k)

Solution (Python):
N,K = map(int,input().split())
if K == 1 :
    print(0)
else:
    print(N-K)

Solution (Python):
n,k=map(int,input().split())
xs=[1]*k
xs[0]+=n-k
print(max(xs)-min(xs))

Solution (Python):
n,k=map(int,input().split())
if k == 1:
  print(0)
else:
  print(n-k)

Solution (Python):
N,K = map(int,input().split())

ans = (0 if K == 1 else N-K)

print(ans)

Solution (Python):
n, k = map(int, input().split())
print(n - k if k > 1 else 0)

Solution (Python):
n, k = map(int, input().split())
if k == 1:
    print(0)
else:
    print(n-k)

Solution (Python):
n, k = map(int, input().split())
ans = n - k
if k == 1:
    ans = 0
print(ans)

Solution (Python):
N,K = map(int,input().split())
if K == 1:
  ans = 0
else:
  ans = N-K
print(ans)

Solution (Python):
N, K = map(int, input().rstrip().split())

if K == 1:
    print(0)
else:
    print(N - K)

Solution (Python):
N,K = [int(x) for x in input().split()]
if K >= 2:
    print(N-K)
else:
    print(0)

Solution (Python):
N,K=map(int,input().split())

if N > K and K !=1:
	wide = N - K
elif N == K or K==1:
  	wide = 0
else:
    wide = 0
    
print(wide)

Solution (Python):
N, K = map(int, input().split())

if K == 1:
  print(0)
else:
  print(N-K)

Solution (Python):
n, k = map(int, input().split())
if k == 1:
    print("0")
else:
    print(n-k)

Solution (Python):
n,k = map(int,input().split())
if k == 1:
  print(0)
else:
  print(n-k)

Solution (Python):
n,k=map(int,input().split())
if k==1:print(0)
else:print(n-k)

Solution (Python):
n,k=map(int,input().split())
print(0 if k==1 else n-k)

Solution (Python):
N,K = [int(x) for x in input().split()]
print(N%K)

Solution (Python):
n,k = list(map(int,input().split()))
if k == 1:
  print("0")
else:
  print(str(n-k))

Solution (Python):
n,k=map(int,input().split())
ans=n-k if k>1 else 0
print(ans)

Solution (Python):
N, K = [int(_) for _ in input().split()]

if K == 1:
    result = 0
else:
    result = N - (K - 1) - 1

print(result)

Solution (Python):
(N, K) = list(map(int, input().split()))
max_distribution = N - K
if K == 1:
    max_distribution = 0
print(max_distribution)

Solution (Python):
N,K=map(int,input().split())
Ans=N-K
if K==1:
    print(0)
else:
    print(Ans)

Solution (Python):
n, k = map(int, input().split())

print(n - k if k != 1 else 0)

Solution (Python):
import sys
data = sys.stdin.readlines()
data = data[0].split()
N = int(data[0])
K = int(data[1])
if K == 1:
    print(0)
else:
    print(N-K)

Solution (Python):
N,K= map(int,input().split())
if K==1:
  print(0)
else:
  print(N-K)

Solution (Python):
N,K=map(int,input().split())
if K==1:
    print(0)
else:
    print(N-K)

Solution (Python):
N, K = map(int, input().split())

if K == 1:
    print(0)
else:
    print(N-K)

Solution (Python):
N, K = map(int, input().split())

if K == 1:
    print('0')
else:
    print(N - K)

Solution (Python):
n,k=map(int,input().split())
print([n-k,0][k==1])

Solution (Python):
N,K = map(int, input().split())

if K == 1:
    print(0)
else:
    print(N-K)

Solution (Python):
N, K = map(int, input().split())

if(K==1):
  print(0)
else:
  print(N-K)

Solution (Python):
n, k = map(int, input().split())
print(n-k if k != 1 else 0)

Solution (Python):
n, k = map(int, input().split())
ans = 0 if k == 1 else n - k
print(ans)

Solution (Python):
N,K = map(int,input().split())
if K >= 2:
  if N-K+1 >= 1:
    print(N-K)
  else:
    print(0)
else:
  print(0)

Solution (Python):
n,k = map(int,input().split())
if k == 1:
    print(0)
else:
    print(n-k)

Solution (Python):
x = input().split()
n = int(x[0])
k = int(x[1])

if k == 1:
    print("0")

else:
    print(n - k)

Solution (Python):
n, k = [int(i) for i in input().split()]

if k == 1:
	print(0)
else:
	print(n - k)

Solution (Python):
import sys






sys.setrecursionlimit(1000000)
MOD = 10 ** 9 + 7

N, K = [int(x) for x in input().split()]

print(N - K if K != 1 else 0)

Solution (Python):
n,k = map(int,input().split())
if k==1:
    print(0)
else:
    print(n-k)

Solution (Python):
s=list(map(int,input().split()))
if s[1]==1:
  print(0)
else:
  print(s[0]-s[1])

Solution (Python):
N, K = map(int,input().split())
if K==1: print(0)
else: print(N-K)

Solution (Python):
N, K = map(int, input().split())
if(K==1):
  print("0")
else:
  print(N-K)

Solution (Python):
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 998244353
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(): return [list(map(int, l.split())) for l in sys.stdin.readlines()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)
def pe(s): return print(str(s), file=sys.stderr)
def JA(a, sep): return sep.join(map(str, a))
def JAA(a, s, t): return s.join(t.join(map(str, b)) for b in a)


def main():
    n,k = LI()
    if k == 1:
        return 0

    return n - k


print(main())

Solution (Python):
N, K = map(int,input().split())
if K==1: print(0)
else: print(N-K)

Solution (Python):
N, K = map(int, input().split())

if N < K:
    print(1)
elif N == K or K == 1:
    print(0)
else:
    print(N - K)

Solution (Python):
N, K = map(int, input().split())
if K == 1:
    print(0)
else:
    print(N-K)

Solution (Python):
N, K = map(int, input().split())

if K == 1:
  ans = 0
elif N == K:
  ans = 0
else:
  ans = N - K
  
print(ans)

Solution (Python):
N, K = list(map(int, input().split()))
if K == 1:
  print(0)
else:
  print(N-K)

Solution (Python):
a,b=[int(i) for i in input().split()]
if b==1:
  print(0)
else:
  print(a-b)

Solution (Python):
from collections import Counter
from collections import deque
from functools import reduce
from pprint import pprint
import bisect
import copy
import fractions
import itertools
import math
import queue
import random
import sys
import time
sys.setrecursionlimit(10**7)
INF = 10 ** 18
MOD = 10 ** 9 + 7
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def MI(): return map(int, sys.stdin.readline().split())
def II(): return int(sys.stdin.readline())
def IS(): return input()
def C(x): return Counter(x)
def GCD_LIST(numbers): return reduce(fractions.gcd, numbers)
def LCM_LIST(numbers): return reduce(LCM, numbers)
def LCM(m, n): return (m * n // fractions.gcd(m, n))


n, k = MI()
if k == 1:
    print(0)
else:
    print(n - k)

Solution (Python):
n,k = map(int,input().split())
if k == 1:print(0)
else:print(n-k)

Solution (Python):
import math


n, k = [int(i) for i in input().split()]








if (k == 1) :
    kotae = 0
else :
    kotae = n - k

print(kotae)

Solution (Python):
def input_func():
    N, K= map(int,input().split())
    return N, K

def evaluate(N,K):
    if K == 1:
        answer = 0
    else:
        answer = N - K
    return answer

if __name__ == '__main__':
    N, K = input_func()
    answer = evaluate(N,K)
    print(answer)

Solution (Python):
N, K = map(int, input().split())
if K == 1:
    print(0)
else:
    print(N-K)

Solution (Python):
N,K=map(int, input().split())

if K==1:
  print(0)
else:
  print(N-K)

Solution (Python):
st = input().split(" ")
n = int(st[0])
m = int(st[1])

if(m == 1):
    print(0)
    exit()

print(n - m)

Solution (Python):
n, k = map(int, input().split())
if(k == 1):
  print(0)
else:
  print(n-k)

Solution (Python):
N, K = map(int, input().split())
if K == 1:
	print(0)
else:
	print(N - K)

Solution (Python):
def ball_distribution(N: int, K: int)->int:
    if K == 1:
        return 0
    return N-K


if __name__ == "__main__":
    N, K = map(int, input().split())

    ans = ball_distribution(N, K)
    print(ans)

Solution (Python):
n,k=map(int,input().split())
if k==1:
    print(0)
else:
    print(n-k)

Solution (Python):
N,K = map(int, input().split())
if (K == 1):
  print(0)
else:
  print(N-K)

Solution (Python):
N, K = [int(_) for _ in input().split()]
if K > 1:
    print(N - K)
else:
    print(0)

Solution (Python):
n,k=map(int,input().split())
if k == 1:
  print(0)
else:
  print(n-k)

Solution (Python):
n, k = map(int, input().split())
print(n-k if k != 1 else 0)

Solution (Python):
n, k = map(int, input().split())
if k > 1:
    print(n - k)
else:
    print(0)

Solution (Python):
n, k = map(int, input().split())

print(0 if k == 1 else n - k)

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

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

Solution (Python):
N, K = input().split()
N, K = int(N), int(K)

if K == 1:
  print(0)
else:
  print(N-K)

Solution (Python):
n,k = (int(i) for i in input().split())
if k-1: print(n-k)
else: print(0)