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())
if k==1:print(0)
elif n==k:print(0)
elif n>k: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())
ans = n-k if k > 1 else 0
print(ans)

Solution (Python):

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

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

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

if b == 1:
    print(0)
else:
    print(a - b)

Solution (Python):
[N,x]=list(map(int, input().split()))

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

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 = [int(i) for i in input().split()]

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

Solution (Python):



from fractions import gcd
from itertools import combinations,permutations,accumulate, product 

from collections import deque,defaultdict,Counter
import decimal
import re
import math
import bisect














import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7


from sys import stdin
readline = stdin.readline
def readInts():
  return list(map(int,readline().split()))
def readTuples():
    return tuple(map(int,readline().split()))
def I():
  return int(readline())
n,k = readInts()
if k == 1:
    print(0)
else:
    if n >= k:
        print(n-k)

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


N, K = LI()

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):
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 = map(int, input().split())
if k != 1:
    print(n-k)
else:
    print(0)

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

Solution (Python):

import sys
def input():
    return sys.stdin.readline()[:-1]

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

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

if __name__ == '__main__':
    main()

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

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

Solution (Python):

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

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:
  x = N-K
  print (x)

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

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

print(n-k)

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

    if k == 1:
        ans = 0
    else:
        ans = n - k

    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
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):
import sys, math
from collections import deque

def input():
    return sys.stdin.readline()[:-1]

def mi():
    return map(int, input().split())

def ii():
    return int(input())

def i2(n):
    tmp = [list(mi()) for i in range(n)]
    return [list(i) for i in zip(*tmp)]

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

if __name__ == '__main__':
    main()

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

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

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

Solution (Python):
'''
Created on 2020/08/20

@author: harurun
'''
def main():
  import sys
  pin=sys.stdin.readline
  pout=sys.stdout.write
  perr=sys.stderr.write
  
  N,K=map(int,pin().split())
  if K==1:
    print(0)
    return 
  t=N-K 
  print(t)
  return 

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())
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())
print(n-k if k!=1 else 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):
a = [int(s) for s in input().split()]
b = a[0] - a[1] + 1
c = a[0] // a[1]
print(int(b - c))

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

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):
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())
print(N%K)

Solution (Python):
import sys

read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


def main():
    N, K = map(int, readline().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())
print(n % k)

Solution (Python):
import bisect, collections, copy, heapq, itertools, math, string, sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = float('inf')
def I(): return int(input())
def F(): return float(input())
def SS(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LSS(): return input().split()

def resolve():
    N, K = LI()

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

if __name__ == '__main__':
    resolve()

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

if y==1:
  print(0)
  exit()
else:
  print(x-y)

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())
print(max((n % k - n // k + 1),0))

Solution (Python):
import sys

input = sys.stdin.readline


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

    if K == 1:
        ans = 0
    else:
        ans = N - K

    print(ans)


if __name__ == "__main__":
    main()

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

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 = map(int,input().split())
if K == 1:
    print(0)
else:
    print(N - K)

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

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):
def main():
    N, K = map(int, input().split())

    if K == 1:
        print(0)
    else:
        print(N - (K - 1) - 1)
        
if __name__ == "__main__":
    main()

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 else 0
print(ans)

Solution (Python):
a,b = map(int,input().split())
x = []
for i in range(b):
    x.append(1)
    a = a - 1
for i in range(a):
    x[0] = x[0] + 1
x.sort()
print(abs(x[0] - x[len(x) - 1]))

Solution (Python):
n, k = map(int, input().split())
ans = 0
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):
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(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(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())
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:
        print(0)
        exit()

    print(N - K)


if __name__ == "__main__":
    main()

Solution (Python):


import sys
from typing import Any, Callable, Deque, Dict, List, Mapping, Optional, Sequence, Set, Tuple, TypeVar, Union































def main():
    Num = Union[int, float]
    mod = 1000000007                
    inf = float('inf')              
    
    sys.setrecursionlimit(10**6)    
    def input(): return sys.stdin.readline().rstrip()
    def ii():    return int(input())
    def isp():   return input().split()
    def mi():    return map(int, input().split())
    def mi_0():  return map(lambda x: int(x)-1, input().split())
    def lmi():   return list(map(int, input().split()))
    def lmi_0(): return list(map(lambda x: int(x)-1, input().split()))
    def li():    return list(input())
    
    
    
    n, k = mi()
    if k == 1:
        print(0)
    else:
        print(n - k)


if __name__ == "__main__":
    main()

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

def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    N,K=MI()
    if K==1:
        print(0)
    else:
        print(N-K)

main()

Solution (Python):
def main():
    n, k = list(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())
if K == 1:
    print(0)
else:
    print(N - K)

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

if k==1:
    print('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):
n,k=map(int,input().split());print(0 if k<=1 else n-k)

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

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

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

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)

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10**9 + 7


N, K = MAP()

print(N-K if 1 < K else 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:
    ans = n - k
else:
    ans = 0
    
print(ans)

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

if b == 1:
    print(0)
else:
    print(a-b)

Solution (Python):






import sys
input = sys.stdin.readline

import math

import bisect
from collections import defaultdict
from collections import deque
from collections import Counter
from functools import lru_cache






MOD = 10**9+7
INF = float('inf')






def I(): return int(input().strip())
def S(): return input().strip()
def IL(): return list(map(int,input().split()))
def SL(): return list(map(str,input().split()))
def ILs(n): return list(int(input()) for _ in range(n))
def SLs(n): return list(input().strip() for _ in range(n))
def ILL(n): return [list(map(int, input().split())) for _ in range(n)]
def SLL(n): return [list(map(str, input().split())) for _ in range(n)]


def P(arg): print(arg); return
def Y(): print("Yes"); return
def N(): print("No"); return
def E(): exit()
def PE(arg): print(arg); exit()
def YE(): print("Yes"); exit()
def NE(): print("No"); exit()


def DD(arg): return defaultdict(arg)



def inv(n): return pow(n, MOD-2, MOD)


kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret


def factorization(n):
  arr = []
  temp = n
  for i in range(2, int(-(-n**0.5//1))+1):
    if temp%i==0:
      cnt=0
      while temp%i==0: 
        cnt+=1 
        temp //= i
      arr.append([i, cnt])
  if temp!=1:
    arr.append([temp, 1])
  if arr==[]:
    arr.append([n, 1])
  return arr


def make_divisors(n):
  divisors = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      divisors.append(i)
      if i != n // i: 
        divisors.append(n//i)
  return divisors


def make_primes(N):
  max = int(math.sqrt(N))
  seachList = [i for i in range(2,N+1)]
  primeNum = []
  while seachList[0] <= max:
    primeNum.append(seachList[0])
    tmp = seachList[0]
    seachList = [i for i in seachList if i % tmp != 0]
  primeNum.extend(seachList)
  return primeNum


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


def lcm(a, b):
    return a * b // gcd (a, b)


def count_bit(n):
  count = 0
  while n:
    n &= n -1
    count += 1
  return count


def base_10_to_n(X, n):
  if X//n:
    return base_10_to_n(X//n, n)+[X%n]
  return [X%n]

def base_n_to_10(X, n):
  return sum(int(str(X)[-i-1])*n**i for i in range(len(str(X))))


def int_log(n, a):
  count = 0
  while n>=a:
    n //= a
    count += 1
  return count




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

Solution (Python):
N, K = map(int, input().split())
ans = N - K if K > 1 else 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:
    print(0)
else:
    print(N - K)

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

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

ans = N - K
print(ans)

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

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

Solution (Python):
import sys

stdin = sys.stdin
inf = 1 << 60
mod = 1000000007

sys.setrecursionlimit(10**7)

ni = lambda: int(ns())
nin = lambda y: [ni() for _ in range(y)]
na = lambda: list(map(int, stdin.readline().split()))
nan = lambda y: [na() for _ in range(y)]
nf = lambda: float(ns())
nfn = lambda y: [nf() for _ in range(y)]
nfa = lambda: list(map(float, stdin.readline().split()))
nfan = lambda y: [nfa() for _ in range(y)]
ns = lambda: stdin.readline().rstrip()
nsn = lambda y: [ns() for _ in range(y)]
ncl = lambda y: [list(ns()) for _ in range(y)]
nas = lambda: stdin.readline().split()

n, k = na()

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

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




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










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

if __name__ == '__main__':
    main()

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

Solution (Python):
from statistics import median


from fractions import gcd
from itertools import combinations 
from collections import deque
from collections import defaultdict
import bisect










import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
n,m = readInts()
print(n-m if m != 1 else 0)

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

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


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


if __name__ == '__main__':
    resolve()

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)

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=map(int,input().split())
print(0 if K==1 or N==K else 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):
N,K = list(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
import math
import bisect

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())
if k == 1:
    print(0)
else:
    print(n-k)

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

if x==y or y==1:
	print(0)
else:
	print(x-y)

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 sys
def input(): return sys.stdin.readline().strip()

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

Solution (Python):


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

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

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-1)-1)

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

mi = 1
ma = 1 + n-k

if(k==1):
    print(0)
else:
    print(ma-mi)

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

print(n%k)

Solution (Python):
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())

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

if N > K:
  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):
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    

    
    

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

if __name__ == '__main__':
    main()

Solution (Python):

def inputlist(): return [int(k) for k in input().split()]

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

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

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):
import sys
from sys import stdin

n, k = map(int, stdin.readline().rstrip().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())
MAX=N-K+1
print(MAX-1 if K!=1 else 0)

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

if __name__=='__main__':
    main()

Solution (Python):
import sys
def input(): return sys.stdin.readline().rstrip()
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())
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):
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:
	max = N - (K - 1)
	print(max - 1)

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

A=N-K

if K>1:
  print(A)
else:
  print(0)

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(0 if k == 1 else n-k)

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

if b == 1:
  ans = 0
else:
  ans = a - b
print(ans)

Solution (Python):
N,K = list(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 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())
if K == 1: print(0)
else: print(N - K)

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

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 sys
import copy
import math
import bisect
import pprint
import bisect
from functools import reduce
from copy import deepcopy
from collections import deque

def lcm(x, y):
    return (x * y) // math.gcd(x, y)

if __name__ == '__main__':
    a = [int(i) for i in input().split()]

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

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):
N, K = map(int, input().split())
if N == K or K == 1:
    print(0)
else:
    print(N - K)

Solution (Python):
N, K = map(int, input().split())
if 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())
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())

print((n-k+1) - n//k)

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


if __name__ == '__main__':
    solve()

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())
ans = n - k
print(ans if ans >= 0 and 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(int(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:
    mx = n - k + 1
    ans = mx - 1
    print(ans)

Solution (Python):
def main():
    balls, people = map(int, input().split())
    print(0 if people == balls or people == 1 else balls - people)


if __name__ == '__main__':
    main()

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

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

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

print(ans)

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

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

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

print(N % K)

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

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

Solution (Python):









import sys



ipti = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)

def main():
    n, k = list(map(int,ipti().split()))
    if k == 1:
        print(0)
    else:
        print(n-k)

if __name__ == '__main__':
    main()

Solution (Python):
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)
    exit()
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())
a = N//K
print(N-a*K)

Solution (Python):
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())
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())
n = N % K
print(n)

Solution (Python):


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

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

Solution (Python):
n,k = map(int, input().split())
if k>=2:
    print(n-k)
else:
    print(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 N == K or K == 1 else N - K)

Solution (Python):
n,k = map(int,input().split())
if k >= 2: 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())
print(N % K)

Solution (Python):
from sys import stdin
N, K = [int(_) for _ in stdin.readline().rstrip().split()]
if K == 1:
  print(0)
else:
  print(N-K)

Solution (Python):


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


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

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

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

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

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

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