import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.BitSet;
import java.util.Calendar;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.PriorityQueue;
import java.util.SortedSet;
import java.util.Stack;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;

/**
 * #
 * @author pttrung
 */
public class C_Edu_Round_23 {

    public static long MOD = 1000000007;
    static long[][][][] dp;

    public static void main(String[] args) throws FileNotFoundException {
        // PrintWriter out = new PrintWriter(new FileOutputStream(new File(
        // "output.txt")));
        PrintWriter out = new PrintWriter(System.out);
        Scanner in = new Scanner();
        long n = in.nextLong();
        long s = in.nextLong();
        if (s == 0) {
            out.println(n);
        } else {
            String N = "" + n;
            dp = new long[N.length()][163][2][2];
            long re = 0;
            for (int i = 1; i < 163 && i <= n; i++) {
                long tmp = s + i;
                if (tmp <= n) {
                    String S = "" + tmp;
                    while(S.length() < N.length()){
                        S = '0' + S;
                    }
                    for (long[][][] a : dp) {
                        for (long[][] b : a) {
                            for (long[] c : b) {
                                Arrays.fill(c, -1);
                            }
                        }
                    }
                    re += cal(0, i, 0, 0, N, S);
                }
            }
            out.println(re);
        }
        out.close();
    }

    public static long cal(int index, int left, int lessThanN, int largerThanS, String n, String s) {
        if (index == n.length()) {
            if (left == 0) {
                return 1;
            }
            return 0;
        }
        if (dp[index][left][lessThanN][largerThanS] != -1) {
            return dp[index][left][lessThanN][largerThanS];
        }
        int x = n.charAt(index) - '0';
        int y = s.charAt(index) - '0';
        long re = 0;
        for (int i = 0; i < 10 && i <= left; i++) {
            if (i <= x || lessThanN == 1) {
                if (i >= y || largerThanS == 1) {
                    re += cal(index + 1, left - i, i < x ? 1 : lessThanN, i > y ? 1 : largerThanS, n, s);
                }
            }
        }
        return dp[index][left][lessThanN][largerThanS] = re;
    }

    public static int[] KMP(String val) {
        int i = 0;
        int j = -1;
        int[] result = new int[val.length() + 1];
        result[0] = -1;
        while (i < val.length()) {
            while (j >= 0 && val.charAt(j) != val.charAt(i)) {
                j = result[j];
            }
            j++;
            i++;
            result[i] = j;
        }
        return result;

    }

    public static boolean nextPer(int[] data) {
        int i = data.length - 1;
        while (i > 0 && data[i] < data[i - 1]) {
            i--;
        }
        if (i == 0) {
            return false;
        }
        int j = data.length - 1;
        while (data[j] < data[i - 1]) {
            j--;
        }
        int temp = data[i - 1];
        data[i - 1] = data[j];
        data[j] = temp;
        Arrays.sort(data, i, data.length);
        return true;
    }

    public static int digit(long n) {
        int result = 0;
        while (n > 0) {
            n /= 10;
            result++;
        }
        return result;
    }

    public static double dist(long a, long b, long x, long y) {
        double val = (b - a) * (b - a) + (x - y) * (x - y);
        val = Math.sqrt(val);
        double other = x * x + a * a;
        other = Math.sqrt(other);
        return val + other;

    }

    public static class Point implements Comparable<Point> {

        int x, y;

        public Point(int start, int end) {
            this.x = start;
            this.y = end;
        }

        @Override
        public int hashCode() {
            int hash = 5;
            hash = 47 * hash + this.x;
            hash = 47 * hash + this.y;
            return hash;
        }

        @Override
        public boolean equals(Object obj) {
            if (obj == null) {
                return false;
            }
            if (getClass() != obj.getClass()) {
                return false;
            }
            final Point other = (Point) obj;
            if (this.x != other.x) {
                return false;
            }
            if (this.y != other.y) {
                return false;
            }
            return true;
        }

        @Override
        public int compareTo(Point o) {
            return Integer.compare(x, o.x);
        }
    }

    public static class FT {

        long[] data;

        FT(int n) {
            data = new long[n];
        }

        public void update(int index, long value) {
            while (index < data.length) {
                data[index] += value;
                index += (index & (-index));
            }
        }

        public long get(int index) {
            long result = 0;
            while (index > 0) {
                result += data[index];
                index -= (index & (-index));
            }
            return result;

        }
    }

    public static long gcd(long a, long b) {
        if (b == 0) {
            return a;
        }
        return gcd(b, a % b);
    }

    public static long pow(long a, long b, long MOD) {
        if (b == 0) {
            return 1;
        }
        if (b == 1) {
            return a;
        }
        long val = pow(a, b / 2, MOD);
        if (b % 2 == 0) {
            return val * val % MOD;
        } else {
            return val * (val * a % MOD) % MOD;

        }
    }

    static class Scanner {

        BufferedReader br;
        StringTokenizer st;

        public Scanner() throws FileNotFoundException {
            // System.setOut(new PrintStream(new BufferedOutputStream(System.out), true));
            br = new BufferedReader(new InputStreamReader(System.in));
            //  br = new BufferedReader(new InputStreamReader(new FileInputStream(new File("input.txt"))));
        }

        public String next() {

            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (Exception e) {
                    throw new RuntimeException();
                }
            }
            return st.nextToken();
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public String nextLine() {
            st = null;
            try {
                return br.readLine();
            } catch (Exception e) {
                throw new RuntimeException();
            }
        }

        public boolean endLine() {
            try {
                String next = br.readLine();
                while (next != null && next.trim().isEmpty()) {
                    next = br.readLine();
                }
                if (next == null) {
                    return true;
                }
                st = new StringTokenizer(next);
                return st.hasMoreTokens();
            } catch (Exception e) {
                throw new RuntimeException();
            }
        }
    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.BufferedWriter;
import java.io.Writer;
import java.io.OutputStreamWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Amine L
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastInput in = new FastInput(inputStream);
        FastOutput out = new FastOutput(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        public void solve(int testNumber, FastInput in, FastOutput out) {

            long n = in.nextLong();
            long s = in.nextLong();
            long cnt = 0;
            long res = 0;

            for (long i = s; i <= Math.min(s + 200, n); i++) {
                long d = i;
                int sum = 0;
                while (d > 0) {
                    long l = d % 10;
                    sum += l;
                    d /= 10;
                }
                if ((i - sum) >= s) {
                    cnt++;
                }
            }
            long tmp = n - Math.min(n, s + 200);
            if (tmp < 0) tmp = 0;
            cnt += tmp;
            out.println(cnt);

        }

    }

    static class FastInput {
        private InputStream stream;
        private byte[] buf = new byte[1024];
        private int curChar;
        private int numChars;
        private FastInput.SpaceCharFilter filter;

        public FastInput(InputStream stream) {
            this.stream = stream;
        }

        public int read() {
            if (numChars == -1) {
                throw new InputMismatchException();
            }
            if (curChar >= numChars) {
                curChar = 0;
                try {
                    numChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (numChars <= 0) {
                    return -1;
                }
            }
            return buf[curChar++];
        }

        public long nextLong() {
            int c = read();
            while (isSpaceChar(c)) {
                c = read();
            }
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = read();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9') {
                    throw new InputMismatchException();
                }
                res *= 10;
                res += c - '0';
                c = read();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public boolean isSpaceChar(int c) {
            if (filter != null) {
                return filter.isSpaceChar(c);
            }
            return isWhitespace(c);
        }

        public static boolean isWhitespace(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);

        }

    }

    static class FastOutput {
        private final PrintWriter writer;

        public FastOutput(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public FastOutput(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void close() {
            writer.close();
        }

        public void println(long i) {
            writer.println(i);
        }

    }
}


import java.io.*;
import java.math.*;
import java.util.*;

 public class Main {
	private InputStream is;
	private PrintWriter out;
	int time = 0, dp[][], DP[][], start[], parent[], end[], val[], black[], MOD = (int)(1e9+7), arr[], arr1[];
	int MAX = 10000000, N, K, p;
	ArrayList<Integer>[] amp, amp1;
	boolean b[], b1[];
	Pair prr[];
	char ch[][];
	HashSet<Integer> hs = new HashSet<>();

	public static void main(String[] args) throws Exception {
		new Thread(null, new Runnable() {
		public void run() {
			try {

		//new Main().soln();
		} catch (Exception e) {
				System.out.println(e);
			}
		}
	}, "1", 1 << 26).start();
		new Main().soln();
	}
	void solve() {
		long n = nl(), s = nl();
		long low = 1, high = n+1;
		long ans = high;
		while(low<=high){
			long mid = (high+low)/2;
			if((mid - getSum(mid))>=s){
				high = mid-1;
				ans = mid;
			}
			else{
				low = mid+1;
			}
		}
		System.out.println(Math.max(0, n-ans+1));
	}
	int getSum(long s){
		String str = Long.toString(s);
		int ans = 0;
		for(char ch : str.toCharArray()) ans += (ch-'0');
		return ans;
	}
	int recur(int x){
		//System.out.println(x);
		int ans = 0;
		b[x] = true;
		for(int i : amp[x]){
			if(!b[i]){
				b[i] = true;
				ans = Math.max(recur(i), ans);
				b[i] = false;
			}
		}
		return 1+ans;
	}
	int max = 0;
	int getParent(int x){
		//System.out.println(x+" "+parent[x]);
		if(parent[x]!=x){
			parent[x] = getParent(parent[x]);
		}
		return parent[x];
	}
	int bfs(int x){
		b[x] = true;
		Queue<Integer> q =  new LinkedList<>();
		q.add(x);
		while(!q.isEmpty()){
			int y = q.poll();
			for(int i : amp[y]){
				if(!b[i]){
					b[i] = true;
					val[i] = val[y]+1;
					max = Math.max(val[i], max);
					q.add(i);
				}
			}
		}
		return max;
	}
	class Pair implements Comparable<Pair>{
		int u, v, r;
		Pair(int u, int v){
			this.u = u;
			this.v = v;
		}public int hashCode() {
			return Objects.hash();
		}
		public boolean equals(Object o) {
			Pair other = (Pair) o;
			return ((u == other.u && v == other.v));// || (v == other.u && u == other.v));
		}
		public int compareTo(Pair other) {
			//return Integer.compare(other.r, r);
			return Long.compare(u, other.u) != 0 ? (Long.compare(u, other.u)) : (Long.compare(other.v,v));
		}
		public String toString() {
			return "[u=" + u + ", v=" + v + "]";
		}
	}
	int min(int x,int y){
		if(x<y) return x;
		return y;
	}
	int max(int x,int y){
		if(x>y) return x;
		return y;
	}
	void dfs(int x){
		b[x] = true;
		for(int i : amp[x]){
			if(!b[i]){
				dfs(i);
			}
		}
	}
	void buildGraph(int m){
		while(m-->0)
		{
			int x = ni()-1, y = ni()-1;
			amp[x].add(y);
			amp[y].add(x);
		}
	}
	long modInverse(long a, long mOD2){
        return  power(a, mOD2-2, mOD2);
	}
	long power(long x, long y, long m)
	{
		if (y == 0)
    return 1;
	long p = power(x, y/2, m) % m;
	p = (p * p) % m;

	return (y%2 == 0)? p : (x * p) % m;
	}
	boolean isPrime(int x){
		for(int i = 2;i*1L*i<=x;i++) if(x%i==0) return false;
		return true;
	}
	public long gcd(long a, long b){
		if(b==0) return a;
		return gcd(b,a%b);
	}
	void failFn(String str, int arr[]){
		int len = 0;
		arr[0] = 0;
		int i = 1;
		while(i<arr.length){
			if(str.charAt(i)==str.charAt(len)){
				arr[i++] = ++len;
				continue;
			}
			if(len == 0){
				arr[i] = len;
				i++;
				continue;
			}
			if(str.charAt(i)!=str.charAt(len)){
				len = arr[len-1];
			}
		}
	}
	static class ST1{
		int arr[], st[], size;
		ST1(int a[]){
			arr = a.clone();
			size = 10*arr.length;
			st = new int[size];
			build(0,arr.length-1,1);
		}
		void build(int ss, int se, int si){
			if(ss==se){
				st[si] = arr[ss];
				return;
			}
			int mid = (ss+se)/2;
			int val = 2*si;
			build(ss,mid,val); build(mid+1,se,val+1);
			st[si] = (st[val]+ st[val+1]);
		}
		int get(int ss, int se, int l, int r, int si){
			if(l>se || r<ss || l>r) return Integer.MAX_VALUE;
			if(l<=ss && r>=se) return st[si];
			int mid = (ss+se)/2;
			int val = 2*si;
			return (get(ss,mid,l,r,val)+ get(mid+1,se,l,r,val+1));
		}
	}
	static class ST{
		int arr[],lazy[],n;
		ST(int a){
			n = a;
			arr = new int[10*n];
			lazy = new int[10*n];
		}
		void up(int l,int r,int val){
			update(0,n-1,0,l,r,val);
		}
		void update(int l,int r,int c,int x,int y,int val){
			if(lazy[c]!=0){
				lazy[2*c+1]+=lazy[c];
				lazy[2*c+2]+=lazy[c];
				if(l==r)
					arr[c]+=lazy[c];
				lazy[c] = 0;
			}
			if(l>r||x>y||l>y||x>r)
				return;
			if(x<=l&&y>=r){
				lazy[c]+=val;
				return ;
			}
			int mid = l+r>>1;
			update(l,mid,2*c+1,x,y,val);
			update(mid+1,r,2*c+2,x,y,val);
			arr[c] = (arr[2*c+1]+ arr[2*c+2]);
		}
		int an(int ind){
			return ans(0,n-1,0,ind);
		}
		int ans(int l,int r,int c,int ind){
			if(lazy[c]!=0){
				lazy[2*c+1]+=lazy[c];
				lazy[2*c+2]+=lazy[c];
				if(l==r)
					arr[c]+=lazy[c];
				lazy[c] = 0;
			}
			if(l==r)
				return arr[c];
			int mid = l+r>>1;
			if(mid>=ind)
				return ans(l,mid,2*c+1,ind);
			return ans(mid+1,r,2*c+2,ind);
		}
	}
	public static class FenwickTree {

	    int[] array; // 1-indexed array, In this array We save cumulative information to perform efficient range queries and updates

	    public FenwickTree(int size) {
	        array = new int[size + 1];
	    }
	    public int rsq(int ind) {
	        assert ind > 0;
	        int sum = 0;
	        while (ind > 0) {
	            sum += array[ind];
	            //Extracting the portion up to the first significant one of the binary representation of 'ind' and decrementing ind by that number
	            ind -= ind & (-ind);
	        }
	        return sum;
	    }
	    public int rsq(int a, int b) {
	        assert b >= a && a > 0 && b > 0;
	        return rsq(b) - rsq(a - 1);
	    }
	    public void update(int ind, int value) {
	        assert ind > 0;
	        while (ind < array.length) {
	            array[ind] += value;
	            //Extracting the portion up to the first significant one of the binary representation of 'ind' and incrementing ind by that number
	            ind += ind & (-ind);
	        }
	    }
	    public int size() {
	        return array.length - 1;
	    }
	}
	public static int[] shuffle(int[] a, Random gen){
		for(int i = 0, n = a.length;i < n;i++)
		{
			int ind = gen.nextInt(n-i)+i;
			int d = a[i];
			a[i] = a[ind];
			a[ind] = d;
		}
	return a;
	}
	long power(long x, long y, int mod){
		long ans = 1;
		while(y>0){
			if(y%2==0){
				x = (x*x)%mod;
				y/=2;
			}
			else{
				ans = (x*ans)%mod;
				y--;
			}
		}
		return ans;
	}
	void soln() {
		is = System.in;
		out = new PrintWriter(System.out);
		long s = System.currentTimeMillis();
		solve();
		//out.close();
		out.flush();
		//tr(System.currentTimeMillis() - s + "ms");
	}

	// To Get Input
	// Some Buffer Methods
	private byte[] inbuf = new byte[1024];
	public int lenbuf = 0, ptrbuf = 0;

	private int readByte() {
		if (lenbuf == -1)
			throw new InputMismatchException();
		if (ptrbuf >= lenbuf) {
			ptrbuf = 0;
			try {
				lenbuf = is.read(inbuf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (lenbuf <= 0)
				return -1;
		}
		return inbuf[ptrbuf++];
	}

	private boolean isSpaceChar(int c) {
		return !(c >= 33 && c <= 126);
	}

	private int skip() {
		int b;
		while ((b = readByte()) != -1 && isSpaceChar(b))
			;
		return b;
	}

	private double nd() {
		return Double.parseDouble(ns());
	}

	private char nc() {
		return (char) skip();
	}
	private String ns() {
		int b = skip();
		StringBuilder sb = new StringBuilder();
		while (!(isSpaceChar(b))) { // when nextLine, (isSpaceChar(b) && b != '
									// ')
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	private char[] ns(int n) {
		char[] buf = new char[n];
		int b = skip(), p = 0;
		while (p < n && !(isSpaceChar(b))) {
			buf[p++] = (char) b;
			b = readByte();
		}
		return n == p ? buf : Arrays.copyOf(buf, p);
	}

	private char[][] nm(int n, int m) {
		char[][] map = new char[n][];
		for (int i = 0; i < n; i++)
			map[i] = ns(m);
		return map;
	}

	private int[] na(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = ni();
		return a;
	}

	private int ni() {
		int num = 0, b;
		boolean minus = false;
		while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
			;
		if (b == '-') {
			minus = true;
			b = readByte();
		}

		while (true) {
			if (b >= '0' && b <= '9') {
				num = num * 10 + (b - '0');
			} else {
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private long nl() {
		long num = 0;
		int b;
		boolean minus = false;
		while ((b = readByte()) != -1 && !((b >= '0' && b <= '9') || b == '-'))
			;
		if (b == '-') {
			minus = true;
			b = readByte();
		}

		while (true) {
			if (b >= '0' && b <= '9') {
				num = num * 10 + (b - '0');
			} else {
				return minus ? -num : num;
			}
			b = readByte();
		}
	}

	private boolean oj = System.getProperty("ONLINE_JUDGE") != null;

	private void tr(Object... o) {
		if (!oj)
			System.out.println(Arrays.deepToString(o));
	}
}


import java.util.Scanner;

public class C {
	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		long n = scan.nextLong();
		long s = scan.nextLong();
		long low = 0;
		long high = n + 1;
		while (high-low>1) {
			long sum = 0;
			long mid = (high + low) / 2;
			long value = findSum(mid, sum);
			if (mid - value >= s)
				high = mid;
			else
				low = mid;
		}

		System.out.println(n - high + 1);

		scan.close();
	}

	public static long findSum(long n, long sum) {
		if (n == 0)
			return sum;
		return findSum(n / 10, sum + n % 10);
	}

}


import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.util.*;

public class ed817Q3 {
	public static void main(String[] args){
		InputReader in = new InputReader(System.in);
		PrintWriter out = new PrintWriter(System.out);
		int t = 1;
		for(int zxz=0;zxz<t;zxz++){
			// my code starts here
			long n = in.nextLong();
			long s = in.nextLong();
			long start=0,end=n;
			long ans=n+1;
			while(start<=end){
				long mid = start+(end-start)/2;
				if(mid-digitSum(mid)>=s){
					ans = mid;
					end = mid-1;
				}
				else{
					start=mid+1;
				}
			}
			System.out.println(n-ans+1);
			// my code ends here
		}
	}
	static int digitSum(long n){
		int sum=0;
		while(n>0){
			sum+=n%10;
			n=n/10;
		}
		return sum;
	}
	static class InputReader {

        private InputStream stream;
        private byte[] buf = new byte[8192];
        private int curChar, snumChars;
        private SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int snext() {
            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long nextLong() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int[] nextIntArray(int n) {
            int a[] = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }

        public String readString() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
    }
}


import java.io.*;
import java.util.*;

public class CF817C {
	static long count(long x) {
		return x < 10 ? x : count(x / 10) + x % 10;
	}
	static boolean check(long x, long s) {
		return x - count(x) >= s;
	}
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st = new StringTokenizer(br.readLine());
		long n = Long.parseLong(st.nextToken());
		long s = Long.parseLong(st.nextToken());
		int d = 9 * 18;
		long cnt;
		if (n >= s + d) {
			cnt = n - s - d;
			for (long x = s; x <= s + d; x++)
				if (check(x, s))
					cnt++;
		} else {
			cnt = 0;
			for (long x = s; x <= n; x++)
				if (check(x, s))
					cnt++;
		}
		System.out.println(cnt);
	}
}


import java.util.*;
import java.io.*;

@SuppressWarnings("Duplicates")
public class C817 {
    private FastScanner in;
    private PrintWriter out;

    private long calcSum(long x) {
        int ans = 0;
        while (x > 0) {
            ans += x % 10;
            x /= 10;
        }
        return ans;
    }

    private long calcDiff(long x) {
        return x - calcSum(x);
    }

    private long binSearch(long n, long s) {
        long l = 0;
        long r = n + 1;

        while (r - l > 1) {
            long m = (r + l) >> 1;
            if (calcDiff(m) >= s) {
                r = m;
            } else {
                l = m;
            }
        }
        return l;
    }

    private void solve() throws IOException {
        long n = in.nextLong();
        long s = in.nextLong();

        long ans = binSearch(n, s);

        out.println(n - ans);
    }

    private void run() {
        try {
            in = new FastScanner(System.in);
            out = new PrintWriter(System.out);

            solve();

            out.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    class FastScanner {
        BufferedReader br;
        StringTokenizer st;

        FastScanner(InputStream f) {
            br = new BufferedReader(new InputStreamReader(f));
        }

        FastScanner(File f) {
            try {
                br = new BufferedReader(new FileReader(f));
            } catch (FileNotFoundException e) {
                e.printStackTrace();
            }
        }

        String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }
    }

    public static void main(String[] arg) {
        new C817().run();
    }
}


import java.util.Scanner;

public class Main
{

    public static void main(String[] args)
    {
        setup();
        xuly();
    }

    private static long dp[][] = new long[20][170];

    private static void setup() {
        dp[0][0] = 1;
        for (int i = 1; i < 20; i ++)
            for (int j = 0; j < 170; j ++)
                for (int k = Math.max(j - 9, 0); k <= j; k ++)
                    dp[i][j] += dp[i - 1][k];
    }

    private static int sumD(long x) {
        int ret = 0;
        while(x > 0) {
            ret += x % 10;
            x /= 10;
        }
        return ret;
    }

    private static long numSatisfy(long limit, int sumDigit) {
        long ret = 0;
        int curSum = sumD(limit);
        if (curSum == sumDigit)
            ret ++;

        for (int i = 0; i < 20; i ++) {
            int bound = (int) (limit % 10);
            curSum -= bound;
            for (int d = 0; d < bound && curSum + d <= sumDigit; d ++)
                ret += dp[i][sumDigit - curSum - d];
            limit /= 10;
        }

        return ret;
    }

    private static void xuly() {
        Scanner scanner = new Scanner(System.in);
        long n = scanner.nextLong();
        long s = scanner.nextLong();
        long ans = 0;
        for (int sum = 1; sum < 170; sum ++)
            if (n >= s + sum)
                ans += numSatisfy(n, sum) - numSatisfy(s + sum - 1, sum);
        System.out.print(ans);
    }
}


import java.util.*;
import java.io.*;

public class _817C {

    static long sum = 0;

    static long BSearch2(long st, long end, long lim) {

        if (st > end) return 0;
        long mid = (st + end) >> 1;
        if (mid - sumDigit(mid) >= lim) {
            sum = mid;
            return BSearch2(st, mid - 1, lim);
        }
        if (mid - sumDigit(mid) < lim)
            return BSearch2(mid + 1, end, lim);
        return 0;
    }

    public static void main(String[] args) throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st = new StringTokenizer(in.readLine());
        long s = Long.parseLong(st.nextToken());
        long n = Long.parseLong(st.nextToken());
        BSearch2(1, s, n);
        if (sum == 0) System.out.println("0");
        else System.out.println(s - sum + 1);

    }

    static long sumDigit(long z) {
        String s = "" + z;
        int c = 0;
        for (int i = 0; i < s.length(); i++) c += s.charAt(i);
        return c - s.length() * 0x30;
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class C {

	public static void main(String[] args) throws InterruptedException{
		FastScanner scan = new FastScanner();
		PrintWriter out = new PrintWriter(System.out);
		long n = scan.nextLong(), s = scan.nextLong();
		long lo = 1, hi = n+1;
		for(int bs = 0; bs < 100; bs++) {
			long mid = (lo+hi)>>1;
			long mid2 = mid;
			long c = 0;
			while(mid > 0) {
				c += mid%10;
				mid /= 10;
			}
			if(mid2-c < s) lo = mid2;
			else hi = mid2;
		}
		out.println(n-lo);
		out.close();
	}

	static class FastScanner {
		BufferedReader br;
		StringTokenizer st;

		public FastScanner() {
			try	{
				br = new BufferedReader(new InputStreamReader(System.in));
				st = new StringTokenizer(br.readLine());
			} catch (Exception e){e.printStackTrace();}
		}

		public String next() {
			if (st.hasMoreTokens())	return st.nextToken();
			try {st = new StringTokenizer(br.readLine());}
			catch (Exception e) {e.printStackTrace();}
			return st.nextToken();
		}

		public int nextInt() {return Integer.parseInt(next());}

		public long nextLong() {return Long.parseLong(next());}

		public double nextDouble() {return Double.parseDouble(next());}

		public String nextLine() {
			String line = "";
			if(st.hasMoreTokens()) line = st.nextToken();
			else try {return br.readLine();}catch(IOException e){e.printStackTrace();}
			while(st.hasMoreTokens()) line += " "+st.nextToken();
			return line;
		}

		public int[] nextIntArray(int n) {
			int[] a = new int[n];
			for(int i = 0; i < n; i++) a[i] = nextInt();
			return a;
		}

		public long[] nextLongArray(int n){
			long[] a = new long[n];
			for(int i = 0; i < n; i++) a[i] = nextLong();
			return a;
		}

		public double[] nextDoubleArray(int n){
			double[] a = new double[n];
			for(int i = 0; i < n; i++) a[i] = nextDouble();
			return a;
		}

		public char[][] nextGrid(int n, int m){
			char[][] grid = new char[n][m];
			for(int i = 0; i < n; i++) grid[i] = next().toCharArray();
			return grid;
		}
	}

}


import java.util.*;

import javax.swing.Painter;

import java.io.*;

public class C {
	FastScanner in;
	PrintWriter out;
	boolean systemIO = true;

	public static class Pair implements Comparable<Pair> {
		int x;
		int y;
		public Pair(int x, int y) {
			super();
			this.x = x;
			this.y = y;
		}
		@Override
		public int compareTo(Pair o) {
			return x - o.x;
		}

	}

	public static void quickSort(long[] a, int from, int to) {
		if (to - from <= 1) {
			return;
		}
		int i = from;
		int j = to - 1;
		long x = a[from + (new Random()).nextInt(to - from)];
		while (i <= j) {
			while (a[i] < x) {
				i++;
			}
			while (a[j] > x) {
				j--;
			}
			if (i <= j) {
				long t = a[i];
				a[i] = a[j];
				a[j] = t;
				i++;
				j--;
			}
		}
		quickSort(a, from, j + 1);
		quickSort(a, j + 1, to);
	}

	public static long check(long x) {
		long sum = 0;
		long k = x;
		while (x > 0) {
			sum += x % 10;
			x /= 10;
		}
		return k - sum;
	}

	public void solve() throws IOException {
		long n = in.nextLong();
		long s = in.nextLong();
		long ans = 0;
		for (long i = s; i <= Math.min(n, s + 10000L); i++) {
			if (check(i) >= s) {
				ans++;
			}
		}
		ans += (n - Math.min(n, s + 10000L));
		System.out.println(ans);
	}

	public void run() throws IOException {
		if (systemIO) {
			in = new FastScanner(System.in);
			out = new PrintWriter(System.out);
		} else {
			in = new FastScanner(new File("input.txt"));
			out = new PrintWriter(new File("output.txt"));
		}
		solve();

		out.close();
	}

	class FastScanner {
		BufferedReader br;
		StringTokenizer st;

		FastScanner(File f) {
			try {
				br = new BufferedReader(new FileReader(f));
			} catch (FileNotFoundException e) {
				e.printStackTrace();
			}
		}

		FastScanner(InputStream f) {
			br = new BufferedReader(new InputStreamReader(f));
		}

		String nextLine() {
			try {
				return br.readLine();
			} catch (IOException e) {
				return null;
			}
		}

		String next() {
			while (st == null || !st.hasMoreTokens()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

	}

	// AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
	public static void main(String[] arg) throws IOException {
		new C().run();
	}
}


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

/**
 *
 * @author Fuad
 */
public class Codeforces {

    private static boolean greater(long mid, long s) {

        int sum = 0;
        long num = mid;

        while (num != 0) {
            sum += (num % 10);
            num /= 10;

        }

        return mid - sum >= s;
    }

    static class pair {

        int first;
        int second;

        pair(int f, int s) {
            first = f;
            second = s;
        }

        pair() {

        }

    }

    public static void main(String[] args) throws Exception {
        // TODO code application logic here
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        long n, s;

        String arr[] = br.readLine().split(" ");

        n = Long.parseLong(arr[0]);
        s = Long.parseLong(arr[1]);

        long l = 1;
        long h = n;

        while (l < h) {
            long mid = (l + h) / 2;
            if (greater(mid, s)) {
                h = mid;
            } else {
                l = mid + 1;
            }
        }

        System.out.println(greater(h, s) ? n - h + 1 : 0);

    }

}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import java.util.StringTokenizer;

public class Solution {

	long sum(long n){
		long sm = 0;

		while(n!=0){
			sm+=(n%10);
			n/=10;
		}

		return sm;

	}

	void solve() throws IOException{

		long n = in.nextLong();
		long s = in.nextLong();

		long l = 0;
		long h = n+1;
		long ans = -1;

		while(l<h){
			 long mid = (l + h)/2;

			 long sum = sum(mid);

			 if(mid - sum >= s){
				 ans = mid;
				 h = mid;
			 }
			 else
				 l = mid+1;

			// System.out.println(mid);

			// ans = (mid+1);

		}

	//	System.out.println(ans);

		if(ans==-1)
			out.println("0");
		else
			out.println(n+1-ans);

	} // solve

	class FastScanner{
		BufferedReader br;
		StringTokenizer st;

		public FastScanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
			st = new StringTokenizer("");
		}

		public int nextInt() throws IOException{
			 if(st.hasMoreTokens())
				return Integer.parseInt(st.nextToken());
			else{
				st = new StringTokenizer(br.readLine());
				return nextInt();
			}
		}

		public long nextLong() throws IOException{
			 if(st.hasMoreTokens())
				return Long.parseLong(st.nextToken());
			else{
				st = new StringTokenizer(br.readLine());
				return nextLong();
			}
		}

		public String readLine() throws IOException{
			return br.readLine();
		}
	}

	FastScanner in = new FastScanner();
	static PrintWriter out = new PrintWriter(new OutputStreamWriter(System.out));

	public static void main(String args[])throws IOException{
		 new Solution().solve();
		 out.close();
	}

}


import java.io.BufferedReader;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;

public class A {

	static int[] UPPER = new int[64], LOWER = new int[64];
	static long[][][] memo;

	static long dp(int bit, int lims, int digs)
	{
		if(bit == -1)
			return digs == 0 ? 1 : 0;
		if(memo[lims][bit][digs] != -1)
			return memo[lims][bit][digs];
		long ret = 0;
		for(int d = 0, end = digs < 10 ? digs + 1 : 10; d < end; ++d)
			if(((lims & 1) == 1 || d >= LOWER[bit]) && ((lims & 2) == 2 || d <= UPPER[bit]))
				ret += dp(bit - 1, lims | (d > LOWER[bit] ? 1 : 0) | (d < UPPER[bit] ? 2 : 0), digs - d);
		return memo[lims][bit][digs] = ret;
	}

	static void create(int[] x, long n)
	{
		for(int i = 0; i < 64; ++i)
		{
			x[i] = (int) (n % 10);
			n /= 10;
		}
	}

	static void prepMemo(int sod)
	{
		memo = new long[4][64][sod + 1];
		for(long[][] x: memo)
			for(long[] y: x)
				Arrays.fill(y, -1);
	}

	public static void main(String[] args) throws IOException {

		Scanner sc = new Scanner(System.in);
		PrintWriter out = new PrintWriter(System.out);

		long n = sc.nextLong(), s = sc.nextLong();
		create(UPPER, n);
		long ans = 0;
		for(int sod = 1; sod <= 162; ++sod)
		{
			create(LOWER, s + sod);
			prepMemo(sod);
			ans += dp(63, 0, sod);
		}

		out.println(ans);
		out.close();
	}

	static class Scanner
	{
		StringTokenizer st;
		BufferedReader br;

		public Scanner(InputStream s){	br = new BufferedReader(new InputStreamReader(s));}

		public Scanner(String s) throws FileNotFoundException{	br = new BufferedReader(new FileReader(s));}

		public String next() throws IOException
		{
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int nextInt() throws IOException {return Integer.parseInt(next());}

		public long nextLong() throws IOException {return Long.parseLong(next());}

		public String nextLine() throws IOException {return br.readLine();}

		public double nextDouble() throws IOException { return Double.parseDouble(next()); }

		public boolean ready() throws IOException {return br.ready();}
	}
}


import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.util.*;

public class ed817Q3 {
	public static void main(String[] args){
		InputReader in = new InputReader(System.in);
		PrintWriter out = new PrintWriter(System.out);
		int t = 1;
		for(int zxz=0;zxz<t;zxz++){
			// my code starts here
			long n = in.nextLong();
			long s = in.nextLong();
			long start=s,end=n;
			long ans=n+1;
			while(start<=end){
				long mid = start+(end-start)/2;
				if(mid-digitSum(mid)>=s){
					ans = mid;
					end = mid-1;
				}
				else{
					start=mid+1;
				}
			}
			System.out.println(n-ans+1);
			// my code ends here
		}
	}
	static int digitSum(long n){
		int sum=0;
		while(n>0){
			sum+=n%10;
			n=n/10;
		}
		return sum;
	}
	static class InputReader {

        private InputStream stream;
        private byte[] buf = new byte[8192];
        private int curChar, snumChars;
        private SpaceCharFilter filter;

        public InputReader(InputStream stream) {
            this.stream = stream;
        }

        public int snext() {
            if (snumChars == -1)
                throw new InputMismatchException();
            if (curChar >= snumChars) {
                curChar = 0;
                try {
                    snumChars = stream.read(buf);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
                if (snumChars <= 0)
                    return -1;
            }
            return buf[curChar++];
        }

        public int nextInt() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            int res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public long nextLong() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            int sgn = 1;
            if (c == '-') {
                sgn = -1;
                c = snext();
            }
            long res = 0;
            do {
                if (c < '0' || c > '9')
                    throw new InputMismatchException();
                res *= 10;
                res += c - '0';
                c = snext();
            } while (!isSpaceChar(c));
            return res * sgn;
        }

        public int[] nextIntArray(int n) {
            int a[] = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }

        public String readString() {
            int c = snext();
            while (isSpaceChar(c))
                c = snext();
            StringBuilder res = new StringBuilder();
            do {
                res.appendCodePoint(c);
                c = snext();
            } while (!isSpaceChar(c));
            return res.toString();
        }

        public boolean isSpaceChar(int c) {
            if (filter != null)
                return filter.isSpaceChar(c);
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public interface SpaceCharFilter {
            public boolean isSpaceChar(int ch);
        }
    }
}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            long n = in.nextLong();
            long s = in.nextLong();
            long ans = 0;
            long i = 0;
            for (i = s; i <= n; i++) {
                long t = i - sum(i);
                if (t >= s) {
                    if (i % 10 == 9) {
                        break;
                    }
                    ans++;
                }
            }
            if (n >= s) {
                out.println(ans - i + n + 1);
            } else {
                out.println(0);
            }
        }

        static long sum(long a) {
            long sum = 0;
            while (a != 0) {
                sum += (a % 10);
                a /= 10;
            }
            return sum;
        }

    }
}


import java.io.*;
import java.util.*;

public class Main {

    class IOManager {
        BufferedReader reader;
        PrintWriter writer;
        StringTokenizer tokenizer;

        IOManager() {
            reader = new BufferedReader(new InputStreamReader(System.in));
            writer = new PrintWriter(new BufferedOutputStream(System.out));
        }

        IOManager(String file) throws FileNotFoundException {
            reader = new BufferedReader(new FileReader(file));
            writer = new PrintWriter(new BufferedOutputStream(System.out));
        }

        String next() throws IOException {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                String line = reader.readLine();
                if (line == null)
                    throw new IOException("No lines left.");
                tokenizer = new StringTokenizer(line);
            }
            return tokenizer.nextToken();
        }

        public Integer nextInt() throws IOException {
            return Integer.parseInt(next());
        }

        public Long nextLong() throws IOException {
            return Long.parseLong(next());
        }

        public Double nextDouble() throws IOException {
            return Double.parseDouble(next());
        }

        public void writeSpace(Object obj) {
            writer.print(obj.toString() + " ");
        }

        public void writeLine(Object obj) {
            writer.println(obj.toString());
        }

        public void writeDouble(Double x, int n) {
            String format = "%." + n + "f";
            writer.printf(format, x);
        }

        public void write(Object obj) {
            writer.print(obj.toString());
        }

        public void close() {
            writer.close();
        }
    }

    class Pair implements Comparable {
        public long u, v;

        public Pair(long u, long v) {
            this.u = u;
            this.v = v;
        }

        @Override
        public int compareTo(Object o) {
            Pair that = (Pair) o;
            if (Long.compare(u, that.u) != 0)
                return Long.compare(u, that.u);
            return Long.compare(v, that.v);
        }
    }

    class Graph {
        public int n, m;
        public List<Integer>[] adj;

        public Graph(int n, int m) {
            this.n = n;
            this.m = m;
            adj = new List[n + 1];
            for (int i = 0; i <= n; ++i) {
                adj[i] = new ArrayList<>();
            }
        }

        public void add(int u, int v) {
            adj[u].add(v);
        }

        public void add2Ways(int u, int v) {
            add(u, v);
            add(v, u);
        }

        public void dfs(int i, boolean fr[]) {
            fr[i] = false;
            for (int j: adj[i]) {
                if (fr[j]) {
                    dfs(j, fr);
                }
            }
        }

        public boolean isConnected() {
            boolean fr[] = new boolean[n + 1];
            Arrays.fill(fr, true);
            dfs(1, fr);
            for (int i = 2; i <= n; ++i) {
                if (fr[i])
                    return false;
            }
            return true;
        }

        public boolean hasEuclideanPath() {
            if (!isConnected())
                return false;
            int cnt = 0;
            for (int i = 1; i <= n; ++i) {
                if (adj[i].size() % 2 == 1)
                    cnt++;
            }
            return cnt <= 2;
        }

        public boolean dfsHamiltonian(int i, boolean[] fr, int reached) {
            fr[i] = false;
            reached++;
            if (reached == n)
                return true;
            for (int j: adj[i]) {
                if (fr[j]) {
                    if (dfsHamiltonian(j, fr, reached))
                        return true;
                }
            }
            fr[i] = true;
            return false;
        }

        public boolean hasHamiltonianPathFrom(int st) {
            boolean fr[] = new boolean[n + 1];
            Arrays.fill(fr, true);
            return dfsHamiltonian(st, fr, 0);
        }
    }

    // Actually rooted forest
    class Tree extends Graph {

        public Tree(int n, int m) {
            super(n, m);
        }

        public int getHeight(int i) {
            int res = 0;
            for (Integer j: adj[i]) {
                res = Math.max(res, getHeight(j) + 1);
            }
            return res;
        }
    }

    class FenwickTree {
        int n;
        int tree[];

        public FenwickTree() {

        }

        public FenwickTree(int maxn) {
            n = maxn;
            tree = new int[maxn + 10];
        }

        public void add(int i, int x) {
            while (i <= n) {
                tree[i] += x;
                i += i & (-i);
            }
        }

        public void add(int i) {
            add(i, 1);
        }

        public int get(int i) {
            int res = 0;
            while (i > 0) {
                res += tree[i];
                i -= i & (-i);
            }
            return res;
        }
    }

    IOManager ioManager;

    Main() {
        ioManager = new IOManager();
    }

    Main(String file) throws FileNotFoundException {
        ioManager = new IOManager(file);
    }

    long n, s;
    int m, a[], sum[];
    long pow[];
    long f[][];

    void doi(long n) {
        m = 0;
        while (n > 0) {
            a[m++] = (int) (n % 10L);
            n /= 10L;
        }
    }

    int getsum(long n) {
        int res = 0;
        while (n > 0) {
            res += (int) (n % 10L);
            n /= 10L;
        }
        return res;
    }

    void solve() throws IOException {
        n = ioManager.nextLong();
        s = ioManager.nextLong();
        a = new int[100];
        pow = new long[100];
        pow[0] = 1;
        for (int i = 1; i < 100; ++i) {
            pow[i] = pow[i - 1] * 10L;
        }
        doi(n);
        sum = new int[m + 1];
        sum[m] = 0;
        for (int i = m - 1; i >= 0; --i)
            sum[i] = sum[i + 1] + a[i];

        long first = -1;
        for (long i = s + 1; i <= n; ++i) {
            if (i - getsum(i) >= s) {
                first = i;
                break;
            }
        }
        if (first == -1) {
            ioManager.writeLine(0);
            return;
        }
        ioManager.writeLine(n - first + 1);
    }

    void close() {
        ioManager.close();
    }

    public static void main(String args[]) throws IOException {
        Main solver;
        if (!"true".equals(System.getProperty("ONLINE_JUDGE"))) {
            solver = new Main("input.txt");
        } else {
            solver = new Main();
        }
        solver.solve();
        solver.close();
    }
}


import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class C {

	static StringTokenizer st;
	static BufferedReader br;
	static PrintWriter pw;
	public static void main(String[] args) throws IOException {
		br = new BufferedReader(new InputStreamReader(System.in));
		pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
		long n = nextLong();
		long s = nextLong();
		long ans = 0;
		if (s+200 <= n)
			ans += n - (s+200) + 1;
		for (long i = s; i < s+200; i++) {
			if (i <= n && i-sumDigits(i) >= s) {
				ans++;
			}
		}
		System.out.println(ans);
		pw.close();
	}
	private static long sumDigits(long n) {
		long sum = 0;
		while (n > 0) {
			sum += n % 10;
			n /= 10;
		}
		return sum;
	}
	private static int nextInt() throws IOException {
		return Integer.parseInt(next());
	}
	private static long nextLong() throws IOException {
		return Long.parseLong(next());
	}
	private static double nextDouble() throws IOException {
		return Double.parseDouble(next());
	}
	private static String next() throws IOException {
		while (st==null || !st.hasMoreTokens())
			st = new StringTokenizer(br.readLine());
		return st.nextToken();
	}
}


import java.util.Scanner;
import java.io.*;
import java.util.*;
import java.math.*;
import java.lang.*;
import static java.lang.Math.*;

public class TestClass implements Runnable
{
	/*int x,y;
	public TestClass(int x,int y)
	{
		this.x=x;
		this.y=y;
	}*/
	public static void main(String args[])
	{
		new Thread(null, new TestClass(),"TESTCLASS",1<<18).start();
	}
	public void run()
	{
		//Scanner scan=new Scanner(System.in);
		InputReader hb=new InputReader(System.in);
		PrintWriter w=new PrintWriter(System.out);

		long n=hb.nextLong();
		long s=hb.nextLong();

		long start=0;
		long end=n;
		long ans=0;
		while(start<=end)
		{
			long mid=(start+end)/2;
			if(mid-get(mid)>=s)
			{
				end=mid-1;
				ans=mid;
			}
			else
			{
				start=mid+1;
			}
		}
		if(ans<1)
			w.print(0);
		else
			w.print(n-ans+1);
		w.close();
	}

	public long get(long a)
	{
		String str = Long.toString(a);
		int ans = 0;
		for(char ch : str.toCharArray())
			ans += (ch-'0');
		return ans;
	}

	private void shuffle(int[] arr)
	{
		Random ran = new Random();
		for (int i = 0; i < arr.length; i++) {
			int i1 = ran.nextInt(arr.length);
			int i2 = ran.nextInt(arr.length);

			int temp = arr[i1];
			arr[i1] = arr[i2];
			arr[i2] = temp;
		}
	}

	static class DSU
	{
		int parent[];
		int sizeParent[];
		DSU(int n)
		{
			parent=new int[n];
			sizeParent=new int[n];
			Arrays.fill(sizeParent,1);
			for(int i=0;i<n;i++)
				parent[i]=i;
		}

		int find(int x)
		{
			if(x!=parent[x])
				parent[x]=find(parent[x]);
			return parent[x];
		}

		void union(int x,int y)
		{
			x=find(x);
			y=find(y);
			if(sizeParent[x]>=sizeParent[y])
			{
				if(x!=y)
					sizeParent[x]+=sizeParent[y];
				parent[y]=x;
			}
			else
			{
				if(x!=y)
					sizeParent[y]+=sizeParent[x];
				parent[x]=y;
			}
		}
	}

	static class InputReader
	{
		private InputStream stream;
		private byte[] buf = new byte[1024];
		private int curChar;
		private int numChars;
		private SpaceCharFilter filter;

		public InputReader(InputStream stream)
		{
			this.stream = stream;
		}

		public int read()
		{
			if (numChars==-1)
				throw new InputMismatchException();

			if (curChar >= numChars)
			{
				curChar = 0;
				try
				{
					numChars = stream.read(buf);
				}
				catch (IOException e)
				{
					throw new InputMismatchException();
				}

				if(numChars <= 0)
					return -1;
			}
			return buf[curChar++];
		}

		public String nextLine()
		{
			BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
			String str = "";
			try
			{
				str = br.readLine();
			}
			catch (IOException e)
			{
				e.printStackTrace();
			}
			return str;
		}
		public int nextInt()
		{
			int c = read();

			while(isSpaceChar(c))
				c = read();

			int sgn = 1;

			if (c == '-')
			{
				sgn = -1;
				c = read();
			}

			int res = 0;
			do
			{
				if(c<'0'||c>'9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			}
			while (!isSpaceChar(c));

			return res * sgn;
		}

		public long nextLong()
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-')
			{
				sgn = -1;
				c = read();
			}
			long res = 0;

			do
			{
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			}
			while (!isSpaceChar(c));
				return res * sgn;
		}

		public double nextDouble()
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			int sgn = 1;
			if (c == '-')
			{
				sgn = -1;
				c = read();
			}
			double res = 0;
			while (!isSpaceChar(c) && c != '.')
			{
				if (c == 'e' || c == 'E')
					return res * Math.pow(10, nextInt());
				if (c < '0' || c > '9')
					throw new InputMismatchException();
				res *= 10;
				res += c - '0';
				c = read();
			}
			if (c == '.')
			{
				c = read();
				double m = 1;
				while (!isSpaceChar(c))
				{
					if (c == 'e' || c == 'E')
						return res * Math.pow(10, nextInt());
					if (c < '0' || c > '9')
						throw new InputMismatchException();
					m /= 10;
					res += (c - '0') * m;
					c = read();
				}
			}
			return res * sgn;
		}

		public String readString()
		{
			int c = read();
			while (isSpaceChar(c))
				c = read();
			StringBuilder res = new StringBuilder();
			do
			{
				res.appendCodePoint(c);
				c = read();
			}
			while (!isSpaceChar(c));

			return res.toString();
		}

		public boolean isSpaceChar(int c)
		{
			if (filter != null)
				return filter.isSpaceChar(c);
			return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
		}

		public String next()
		{
			return readString();
		}

		public interface SpaceCharFilter
		{
			public boolean isSpaceChar(int ch);
		}
	}

	static class Pair implements Comparable<Pair>
	{
		int a;
		int b;
		String str;
		public Pair(int a,int b)
		{
			this.a=a;
			this.b=b;
			str=min(a,b)+" "+max(a,b);
		}

		public int compareTo(Pair pair)
		{
			if(Integer.compare(a,pair.a)==0)
				return Integer.compare(b,pair.b);

			return Integer.compare(a,pair.a);
		}
	}

}


import java.util.*;
import java.io.*;
import java.math.*;
 public class Q1 {

	static ArrayList<Integer> adj[],adj2[];
	static int color[],cc;
	static long mod=1000000007;
	static TreeSet<Integer> ts[];
	static boolean b[],visited[],possible,ans1,ans2;
	static Stack<Integer> s;
	static int totalnodes,colored,min,minc;
	static int c[];
	static long sum[];
	static HashMap<Integer,Integer> hm;
	public static void main(String[] args) throws IOException {

		//Scanner sc=new Scanner(System.in);
		in=new InputReader(System.in);
		out=new PrintWriter(System.out);
		String n1=in.readString();
		String s1=in.readString();
		long s=Long.parseLong(s1);
		long n=Long.parseLong(n1);

		long l=s-1;
		long r=n+1;
		HashSet<Long> hset=new HashSet<>();
		long last=-1;
		while(l<r)
		{
			long mid=(l+r)/2;
			long sum=0;
			if(hset.contains(mid))
				break;
			String d=String.valueOf(mid);
			for(int i=0;i<d.length();i++)
			{
				sum=sum+(d.charAt(i)-'0');
			}
			//debug(sum);
			hset.add(mid);

			if(mid-sum>=s)
			{
				last=mid;
				r=mid;
			}
			else
			{
				l=mid;
			}
		}
		if(last==-1)
			out.println("0");
		else
		{
			out.println(n-last+1);
		}
		out.close();
		}

	static InputReader in;
	static PrintWriter out;
 	static void dfs(int i,int parent)
	{
 		if(color[i]!=cc)
 			ans1= false;
 		for(int j:adj[i])
 		{
 			if(j!=parent)
 			{
 				dfs(j,i);
 			}
 		}

	}
	/*public static void seive(long n){
		b = new boolean[(int) (n+1)];
	Arrays.fill(b, true);

		for(int i = 2;i*i<=n;i++){
			if(b[i]){
				sum[i]=count[i];
			//	System.out.println(sum[i]+" wf");
				for(int p = 2*i;p<=n;p+=i){
					b[p] = false;
					sum[i]+=count[p];
					//System.out.println(sum[i]);
				}
			}

		}
	}*/
	static class Pair implements Comparable<Pair> {
		int i;
		int j;
		int index;
		public Pair(){

		}
		public Pair(int u, int v,int index) {
			this.i = u;
			this.j= v;
			this.index=index;
		}
		public int compareTo(Pair other) {

				return this.i-other.i;
		}

		/*public String toString() {
			return "[u=" + u + ", v=" + v + "]";
		}*/
	}
	static class Node2{
		Node2 left = null;
		Node2 right = null;
		Node2 parent = null;
		int data;
	}

	//binaryStree
	static class BinarySearchTree{
		Node2 root = null;
		int height = 0;
		int max = 0;
		int cnt = 1;
		ArrayList<Integer> parent = new ArrayList<>();
		HashMap<Integer, Integer> hm = new HashMap<>();
		public void insert(int x){
			Node2 n = new Node2();
			n.data = x;
			if(root==null){
				root = n;
			}
			else{
				Node2 temp = root,temp2 = null;
				while(temp!=null){
					temp2 = temp;
					if(x>temp.data) temp = temp.right;
					else temp = temp.left;
				}
				if(x>temp2.data) temp2.right = n;
				else temp2.left = n;
				n.parent = temp2;
				parent.add(temp2.data);
			}
		}
		public Node2 getSomething(int x, int y, Node2 n){
			if(n.data==x || n.data==y) return n;
			else if(n.data>x && n.data<y) return n;
			else if(n.data<x && n.data<y) return getSomething(x,y,n.right);
			else return getSomething(x,y,n.left);
		}
		public Node2 search(int x,Node2 n){
			if(x==n.data){
				max = Math.max(max, n.data);
				return n;
			}
			if(x>n.data){
				max = Math.max(max, n.data);
				return search(x,n.right);
			}
			else{
				max = Math.max(max, n.data);
				return search(x,n.left);
			}
		}
		public int getHeight(Node2 n){
			if(n==null) return 0;
			height = 1+ Math.max(getHeight(n.left), getHeight(n.right));
			return height;
		}
	}
public static void debug(Object... o) {
	System.out.println(Arrays.deepToString(o));
}

public static String rev(String s)
{
	StringBuilder sb=new StringBuilder(s);
	sb.reverse();
	return sb.toString();
}

static long lcm(long a, long b)
{
    return a * (b / gcd(a, b));
}

static long gcd(long a, long b)
{
    while (b > 0)
    {
        long temp = b;
        b = a % b; // % is remainder
        a = temp;
    }
    return a;
}

public static long max(long x, long y, long z){
		if(x>=y && x>=z) return x;
		if(y>=x && y>=z) return y;
		return z;
	}
	static int[] sieve(int n,int[] arr)
	{
	for(int i=2;i*i<=n;i++)
	{
		if(arr[i]==0)
		{
			for(int j=i*2;j<=n;j+=i)
				arr[j]=1;
		}
	}
	return arr;
	}

static class InputReader {

private final InputStream stream;
private final byte[] buf = new byte[8192];
private int curChar, snumChars;
private SpaceCharFilter filter;

public InputReader(InputStream stream) {
  this.stream = stream;
}

public int snext() {
  if (snumChars == -1)
    throw new InputMismatchException();
  if (curChar >= snumChars) {
    curChar = 0;
    try {
      snumChars = stream.read(buf);
    } catch (IOException e) {
      throw new InputMismatchException();
    }
    if (snumChars <= 0)
      return -1;
  }
  return buf[curChar++];
}

public int nextInt() {
  int c = snext();
  while (isSpaceChar(c)) {
    c = snext();
  }
  int sgn = 1;
  if (c == '-') {
    sgn = -1;
    c = snext();
  }
  int res = 0;
  do {
    if (c < '0' || c > '9')
      throw new InputMismatchException();
    res *= 10;
    res += c - '0';
    c = snext();
  } while (!isSpaceChar(c));
  return res * sgn;
}

public long nextLong() {
  int c = snext();
  while (isSpaceChar(c)) {
    c = snext();
  }
  int sgn = 1;
  if (c == '-') {
    sgn = -1;
    c = snext();
  }
  long res = 0;
  do {
    if (c < '0' || c > '9')
      throw new InputMismatchException();
    res *= 10;
    res += c - '0';
    c = snext();
  } while (!isSpaceChar(c));
  return res * sgn;
}

public int[] nextIntArray(int n) {
	 return nextIntArray(n, 0);
	    }

public int[] nextIntArray(int n, int off) {
	 int[] arr = new int[n + off];
	   for (int i = 0; i < n; i++) {
	    arr[i + off] = nextInt();
	    }
	    return arr;
	    }

public long[] nextLongArray(int n) {
return nextLongArray(n, 0);
	    }

	public long[] nextLongArray(int n, int off) {
	 long[] arr = new long[n + off];
	 for (int i = 0; i < n; i++) {
		  arr[i + off] = nextLong();
		 }
 return arr;
	}

public String readString() {
  int c = snext();
  while (isSpaceChar(c)) {
    c = snext();
  }
  StringBuilder res = new StringBuilder();
  do {
    res.appendCodePoint(c);
    c = snext();
  } while (!isSpaceChar(c));
  return res.toString();
}

public String nextLine() {
  int c = snext();
  while (isSpaceChar(c))
    c = snext();
  StringBuilder res = new StringBuilder();
  do {
    res.appendCodePoint(c);
    c = snext();
  } while (!isEndOfLine(c));
  return res.toString();
}

public boolean isSpaceChar(int c) {
  if (filter != null)
    return filter.isSpaceChar(c);
  return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
}

private boolean isEndOfLine(int c) {
  return c == '\n' || c == '\r' || c == -1;
}

public interface SpaceCharFilter {
  public boolean isSpaceChar(int ch);
}
}

}


import java.io.*;
import java.util.*;

public class Main {
    public static void main(String[] args) throws IOException {
        InputStream inputStream = System.in;
//        InputStream inputStream = new FileInputStream("dijkstra.in");
        OutputStream outputStream = System.out;
//        OutputStream outputStream = new FileOutputStream("dijkstra.out");
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        Answer solver = new Answer();
        solver.solve(in, out);
        out.close();
    }
}

class Answer {
    private int sumd(long x) {
        int sum = 0;
        while (x != 0) {
            sum += x % 10;
            x /= 10;
        }
        return sum;
    }

    private long bin(long l, long r, long s) {
        if (l > r) {
            return -1;
        }
        long x = (l + r) >> 1;
        int sum = sumd(x);
        if (x - sum < s) {
            return bin(x + 1, r, s);
        }
        long t = bin(l, x - 1, s);
        if (t != -1) {
            return t;
        }
        return x;
    }

    public void solve(InputReader in, PrintWriter out) throws IOException {
        long n = in.nextLong();
        long s = in.nextLong();
        long t = bin(1, n, s);
        if (t == -1) {
            out.print("0");
        } else {
            long ans = n - t + 1;
            out.print(ans);
        }
    }
}

class InputReader {
    private BufferedReader reader;
    private StringTokenizer tokenizer;

    InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream), 32768);
        tokenizer = null;
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

    public long nextLong() {
        return Long.parseLong(next());
    }
}


import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;
import java.util.Arrays;
import java.util.ArrayList;

public class C{

	static long s;
	public static void main(String[] args)throws IOException {
		Reader.init(System.in);
		long n=Reader.nextLong();
		s=Reader.nextLong();
		long lo=1,hi=n,mid;
		while(lo<hi){
			mid=(lo+hi)/2;
			if(diff(mid)>=s)
				hi=mid;
			else
				lo=mid+1;
		}
		if(diff(lo)>=s)
			System.out.println(n-lo+1);
		else
			System.out.println(0);
	}

	static long diff(long n){
		String s=String.valueOf(n);
		int sum=0;

		for(int i=0;i<s.length();i++){

			sum+=Integer.parseInt(s.valueOf(s.charAt(i)));
		}
		return (n-sum);
	}

}

/** Class for buffered reading int and double values */
class Reader {
    static BufferedReader reader;
    static StringTokenizer tokenizer;

    /** call this method to initialize reader for InputStream */
    static void init(InputStream input) {
        reader = new BufferedReader(
                     new InputStreamReader(input) );
        tokenizer = new StringTokenizer("");
    }

    /** get next word */
    static String next() throws IOException {
        while ( ! tokenizer.hasMoreTokens() ) {
            //TODO add check for eof if necessary
            tokenizer = new StringTokenizer(
                   reader.readLine() );
        }
        return tokenizer.nextToken();
    }

    static int nextInt() throws IOException {
        return Integer.parseInt( next() );
    }

    static long nextLong() throws IOException {
        return Long.parseLong( next() );
    }

    static double nextDouble() throws IOException {
        return Double.parseDouble( next() );
    }
}


import java.io.*;
import java.util.*;
public class TestClass {
    static PrintWriter out = new PrintWriter(System.out);
    public static void main(String args[] ) throws Exception {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    	String s[] = in.readLine().split(" ");
    	long n = Long.parseLong(s[0]);
    	long k = Long.parseLong(s[1]);
    	long x = bs(n,k);
    	out.println(n-x+1);
        out.close();
    }
    public static long bs(long n,long k)
    {
    	long l=0,h=n;
    	while(l<=h)
    	{
    		long mid = l + (h-l)/2;
    		long x = mid - sum(mid);
    		if(x>=k)
    		{
    			h = mid-1;
    		}
    		else
    		{
    			l = mid+1;
    		}
    	}
    	return l;
    }
    public static long sum(long x)
    {
    	long ans=0;
    	while(x>0)
    	{
    		ans += x%10;
    		x=x/10;
    	}
    	return ans;
    }
}


import java.io.*;
import java.util.*;

public class C
{
	public static void main(String[] args)
	{
		Scanner in = new Scanner(System.in);
		long n = Long.parseLong(in.next());
		long s = Long.parseLong(in.next());
		if(!check(n, s)){
			System.out.println(0);
		}
		else
		{
			long min = 1;
			long max = n;
			while(min != max)
			{
				long mid = (min + max) / 2;
				if(check(mid, s))
				{
					max = mid;
				}
				else
				{
					min = mid + 1;
				}
			}
			//System.out.println("found: " + min);
			System.out.println((n - min + 1));
		}
	}
	public static boolean check(long x, long s)
	{
		if(x - sumd(x) < s)
		{
			return false;
		}
		else
		{
			return true;
		}
	}
	public static long sumd(long x)
	{
		long sum = 0;
		while(x != 0)
		{
			sum += x % 10;
			x /= 10;
		}
		return sum;
	}
}


import java.util.Scanner;

public class ReallyBigNumbers1
{

    public static void main(String[] args)
    {
        Scanner sc = new Scanner(System.in);
        long n = sc.nextLong();
        long s = sc.nextLong();

        int r = 0 ;

        long l = 0L ;
        long u = n ;

        if(  (l-sumDigits(l)< s )  && (u-sumDigits(u)< s ) )
        {
            System.out.println(0);
            return ;
        }

        long specified = 0L ;
        while( true )
        {
            long m = (l + u) / 2L ;

            if( ( m - sumDigits(m) ) >= s && ( (m-1) - sumDigits(m-1) ) < s  )
            {
                specified = m ;
                break ;
            }

            if( l > u  )
                break ;

            else
            {
                if( ( m - sumDigits(m) ) >= s )
                    u = m-1 ;
                else
                    l = m+1 ;
            }
        }

        System.out.println( n-specified+1 );

    }

    public static int sumDigits(long n)
    {
        char [] a = (n+"").toCharArray();
        int sum = 0 ;
        for(int k = 0 ; k < a.length ; k++)
        {
            sum += Integer.parseInt(a[k]+"") ;
        }
        return sum ;
    }

}


import java.io.*;
import java.util.*;

public class Main {

	class IO {
		BufferedReader reader;
		PrintWriter writer;
		StringTokenizer tokenizer;

		IO() {
			reader = new BufferedReader(new InputStreamReader(System.in));
			writer = new PrintWriter(new BufferedOutputStream(System.out));
			tokenizer = new StringTokenizer("");
		}

		IO(String file) throws FileNotFoundException {
			reader = new BufferedReader(new FileReader(file));
			writer = new PrintWriter(new BufferedOutputStream(System.out));
			tokenizer = new StringTokenizer("");
		}

		String next() throws IOException {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				String line = reader.readLine();
				if (line == null)
					return null;
				tokenizer = new StringTokenizer(line);
			}
			return tokenizer.nextToken();
		}

		public Integer nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public Long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public Double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}

		public void write(Object obj) {
			writer.print(obj.toString());
		}

		public void writeSpace(Object obj) {
			writer.print(obj.toString() + " ");
		}

		public void writeLine(Object obj) {
			writer.println(obj.toString());
		}

		public void close() {
			writer.close();
		}
	}

	IO io;

	Main() {
		io = new IO();
	}

	Main(String file) throws FileNotFoundException {
		io = new IO(file);
	}

	void solve() throws IOException {
		long n = io.nextLong(), s = io.nextLong();
		long min = s;
		while (true) {
			min++;
			long sum = 0, tem = min;
			while (tem > 0) {
				sum += tem % 10;
				tem /= 10;
			}
			if (min - sum >= s) break;
		}
		io.write(Math.max(0, n - min + 1));
	}

	void close() {
		io.close();
	}

	public static void main(String args[]) throws IOException {
		// Main solver = new Main("input.txt");
		Main solver = new Main();
		solver.solve();
		solver.close();
	}
}


	        			/*
	        		     * Author- Priyam Vora
	        		     * BTech 2nd Year DAIICT
	        		     */

	        		    import java.awt.Checkbox;
	import java.awt.Point;
	import java.io.*;
	        		    import java.math.*;
	        		    import java.util.*;
	import java.util.Map.Entry;

	import javax.print.attribute.SetOfIntegerSyntax;

	        		    public class Main{
	        		  	private static InputStream stream;
	        		    	private static byte[] buf = new byte[1024];
	        		    	private static int curChar;
	        		    	private static int numChars;
	        		    	private static SpaceCharFilter filter;
	        		    	private static PrintWriter pw;
	        		    	private static long count = 0,mod=1000000007;
	        		    //	private static TreeSet<Integer> ts=new TreeSet[200000];
	        		    	public final static int INF = (int) 1E9;

	        		        public static void main(String[] args) {
	        		        	InputReader(System.in);
	        		    		pw = new PrintWriter(System.out);
	        		            new Thread(null ,new Runnable(){
	        		               public void run(){
	        		                   try{
	        		                       solve();
	        		                       pw.close();
	        		                   } catch(Exception e){
	        		                       e.printStackTrace();
	        		                   }
	        		               }
	        		           },"1",1<<26).start();
	        		       }
	        		        public static void test(){
	        		        	int t=nextInt();
	        		        	while(t-->0){
	        		        		solve();
	        		        	}
	        		        }
	        		        public static long pow(long n, long p,long mod) {
	        					if(p==0)
	        						return 1;
	        					if(p==1)
	        						return n%mod;
	        					if(p%2==0){
	        						long temp=pow(n, p/2,mod);
	        					return (temp*temp)%mod;
	        					}else{
	        						 	long temp=pow(n,p/2,mod);
	        						 	temp=(temp*temp)%mod;
	        						 	return(temp*n)%mod;

	        					}
	        				}
	        		        public static long pow(long n, long p) {
	        					if(p==0)
	        						return 1;
	        					if(p==1)
	        						return n;
	        					if(p%2==0){
	        						long temp=pow(n, p/2);
	        					return (temp*temp);
	        					}else{
	        						 	long temp=pow(n,p/2);
	        						 	temp=(temp*temp);
	        						 	return(temp*n);

	        					}
	        				}
	        		        public static void Merge(long a[],int p,int r){
	        		            if(p<r){
	        		                int q = (p+r)/2;
	        		                Merge(a,p,q);
	        		                Merge(a,q+1,r);
	        		                Merge_Array(a,p,q,r);
	        		            }
	        		        }
	        		        public static void Merge_Array(long a[],int p,int q,int r){
	        		           long b[] = new long[q-p+1];
	        		            long c[] = new long[r-q];
	        		            for(int i=0;i<b.length;i++)
	        		                b[i] = a[p+i];
	        		            for(int i=0;i<c.length;i++)
	        		                c[i] = a[q+i+1];
	        		            int i = 0,j = 0;
	        		            for(int k=p;k<=r;k++){
	        		                if(i==b.length){
	        		                    a[k] = c[j];
	        		                    j++;
	        		                }
	        		                else if(j==c.length){
	        		                    a[k] = b[i];
	        		                    i++;
	        		                }
	        		                else if(b[i]<c[j]){
	        		                    a[k] = b[i];
	        		                    i++;
	        		                }
	        		                else{
	        		                    a[k] = c[j];
	        		                    j++;
	        		                }
	        		            }
	        		        }
	        		    	public static long gcd(long x, long y) {
	        		    		if (x == 0)
	        		    			return y;
	        		    		else
	        		    			return gcd( y % x,x);
	        		    	}	public static boolean isPrime(int n) {
	        		    	// Corner cases
				    		if (n <= 1)
				    			return false;
				    		if (n <= 3)
				    			return true;

				    		// This is checked so that we can skip
				    		// middle five numbers in below loop
				    		if (n % 2 == 0 || n % 3 == 0)
				    			return false;

				    		for (int i = 5; i * i <= n; i = i + 6)
				    			if (n % i == 0 || n % (i + 2) == 0)
				    				return false;

				    		return true;
				    	}
	        		        static LinkedList<Integer> adj[];
	        		        static boolean Visited[];
	        		        static HashSet<Integer> exc;
	        		        static long oddsum[]=new long[1000001];
	        		        static int co=0,ans=0;

	        		        static int n,m;
	        		        static String s[];
	        		        static int ind;
	        		        public static void solve() {

	        		        	long n=nextLong();
	        		        	long s=nextLong();
	        		        	long low=1,high=n,ans=-1;
	        		        	while(low<=high){
	        		        		long mid=(low+high)/2;
	        		        		if(check(mid,s)){
	        		        			ans=mid;
	        		        			high=mid-1;
	        		        		}else
	        		        		{
	        		        			low=mid+1;
	        		        		}

	        		        	}
	        		        	if(ans==-1)
	        		        		pw.println(0);
	        		        	else
	        		        		pw.println(n-ans+1);

	        		        }
	        		        private static boolean check(long mid,long s){
	        		        	long n=mid;
	        		        	int sum=0;
	        		        	while(mid>0){
	        		        		sum+=(mid%10);
	        		        		mid/=10;
	        		        	}
	        		        	if(n-sum >=s)
	        		        		return true;
	        		        	return false;

	        		        }

	        		        static int[] levl;
	        		        static int h_max=0;
	        		     public static void dfs(int curr,int lev){
	        		    	 Visited[curr]=true;
	        		    	 levl[curr]=lev;
	        		    	 h_max=Math.max(h_max, levl[curr]);
	        		    	 for(int x:adj[curr]){
	        		    		 if(!Visited[x]){
	        		    			 dfs(x,lev+1);
	        		    		 }
	        		    	 }
	        		     }

	        		        public static String reverseString(String s) {
	        					StringBuilder sb = new StringBuilder(s);
	        					sb.reverse();
	        					return (sb.toString());
	        				}

	        		        private static void BFS(int sou,int dest){
	        		        	Queue<Integer> q=new LinkedList<Integer>();
	        		        	q.add(sou);
	        		        	Visited[sou]=true;
	        		        	while(!q.isEmpty()){
	        		        		int top=q.poll();

	        		        		for(int i:adj[top]){
	        		        			//pw.println(i+" "+top);
	        		        			if(!Visited[i])
	        		        			{

	        		        				q.add(i);
	        		        			}

	        		        			Visited[i]=true;
	        		        			if(i==dest){
	        		        				pw.println("Yes");
	        		        			return;
	        		        			}
	        		        		}
	        		        	}
	        		        	pw.println("No");

	        		        }

	        		        private static long ncr(int n,int k){
	    				    	if (k < 0 || k > n) return 0;
	    				        if (n-k < k) k = n-k;

	    				        BigInteger x = BigInteger.ONE;
	    				        for (int i = 1; i <= k; i++) {
	    				            x = x.multiply(new BigInteger(""+(n-i+1)));
	    				            x = x.divide(new BigInteger(""+i));
	    				        }

	    				return x.longValue();
	    				    }
	        		       private  static long fact(long count){
	        		        	long ans=1;
	        		        	for(int i=1;i<=count;i++){
	        		        		ans*=i;
	        		        	}
	        		        	return ans;
	        		        }

	        		        static int state=1;
	        		        static long no_exc=0,no_vert=0;
	        		      static Stack<Integer> st;
	        		      static HashSet<Integer> inset;
	        		        private static void topo(int curr){

	        		        	Visited[curr]=true;
	        		        	inset.add(curr);
	        		        	for(int x:adj[curr]){
	        		        		if(adj[x].contains(curr) || inset.contains(x)){
	        		        			state=0;
	        		        			return;
	        		        		}
	        		        		if(state==0)
	        		        			return;

	        		        	}
	        		        	st.push(curr);

	        		        	inset.remove(curr);
	        		        }
	        		        static HashSet<Integer> hs;

	        		     	private static void buildgraph(int n){
	        		    		adj=new LinkedList[n+1];
	        		    		Visited=new boolean[n+1];

	        		    		for(int i=0;i<=n;i++){
	        		    			adj[i]=new LinkedList<Integer>();

	        		    		}

	        		    	}

	        		    	// To Get Input
	        		    	// Some Buffer Methods

	        		     	public static void sort(long a[]){
	        		     		Merge(a, 0, a.length-1);
	        		     	}
	        		    	public static void InputReader(InputStream stream1) {
	        		    		stream = stream1;
	        		    	}

	        		    	private static boolean isWhitespace(int c) {
	        		    		return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
	        		    	}

	        		    	private static boolean isEndOfLine(int c) {
	        		    		return c == '\n' || c == '\r' || c == -1;
	        		    	}

	        		    	private static int read() {
	        		    		if (numChars == -1)
	        		    			throw new InputMismatchException();
	        		    		if (curChar >= numChars) {
	        		    			curChar = 0;
	        		    			try {
	        		    				numChars = stream.read(buf);
	        		    			} catch (IOException e) {
	        		    				throw new InputMismatchException();
	        		    			}
	        		    			if (numChars <= 0)
	        		    				return -1;
	        		    		}
	        		    		return buf[curChar++];
	        		    	}

	        		    	private static int nextInt() {
	        		    		int c = read();
	        		    		while (isSpaceChar(c))
	        		    			c = read();
	        		    		int sgn = 1;
	        		    		if (c == '-') {
	        		    			sgn = -1;
	        		    			c = read();
	        		    		}
	        		    		int res = 0;
	        		    		do {
	        		    			if (c < '0' || c > '9')
	        		    				throw new InputMismatchException();
	        		    			res *= 10;
	        		    			res += c - '0';
	        		    			c = read();
	        		    		} while (!isSpaceChar(c));
	        		    		return res * sgn;
	        		    	}

	        		    	private static long nextLong() {
	        		    		int c = read();
	        		    		while (isSpaceChar(c))
	        		    			c = read();
	        		    		int sgn = 1;
	        		    		if (c == '-') {
	        		    			sgn = -1;
	        		    			c = read();
	        		    		}
	        		    		long res = 0;
	        		    		do {
	        		    			if (c < '0' || c > '9')
	        		    				throw new InputMismatchException();
	        		    			res *= 10;
	        		    			res += c - '0';
	        		    			c = read();
	        		    		} while (!isSpaceChar(c));
	        		    		return res * sgn;
	        		    	}

	        		    	private static String nextToken() {
	        		    		int c = read();
	        		    		while (isSpaceChar(c))
	        		    			c = read();
	        		    		StringBuilder res = new StringBuilder();
	        		    		do {
	        		    			res.appendCodePoint(c);
	        		    			c = read();
	        		    		} while (!isSpaceChar(c));
	        		    		return res.toString();
	        		    	}

	        		    	private static String nextLine() {
	        		    		int c = read();
	        		    		while (isSpaceChar(c))
	        		    			c = read();
	        		    		StringBuilder res = new StringBuilder();
	        		    		do {
	        		    			res.appendCodePoint(c);
	        		    			c = read();
	        		    		} while (!isEndOfLine(c));
	        		    		return res.toString();
	        		    	}

	        		    	private static int[] nextIntArray(int n) {
	        		    		int[] arr = new int[n];
	        		    		for (int i = 0; i < n; i++) {
	        		    			arr[i] = nextInt();
	        		    		}
	        		    		return arr;
	        		    	}

	        		    	private static long[][] next2dArray(int n, int m) {
	        		    		long[][] arr = new long[n][m];
	        		    		for (int i = 0; i < n; i++) {
	        		    			for (int j = 0; j < m; j++) {
	        		    				arr[i][j] = nextLong();
	        		    			}
	        		    		}
	        		    		return arr;
	        		    	}
	        		    	private static char[][] nextCharArray(int n,int m){
	        		    		char [][]c=new char[n][m];
	        		    		for(int i=0;i<n;i++){
	        		    			String s=nextLine();
	        		    			for(int j=0;j<s.length();j++){
	        		    				c[i][j]=s.charAt(j);
	        		    			}
	        		    		}
	        		    		return c;
	        		    	}

	        		    	private static long[] nextLongArray(int n) {
	        		    		long[] arr = new long[n];
	        		    		for (int i = 0; i < n; i++) {
	        		    			arr[i] = nextLong();
	        		    		}
	        		    		return arr;
	        		    	}

	        		    	private static void pArray(int[] arr) {
	        		    		for (int i = 0; i < arr.length; i++) {
	        		    			pw.print(arr[i] + " ");
	        		    		}
	        		    		pw.println();
	        		    		return;
	        		    	}

	        		    	private static void pArray(long[] arr) {
	        		    		for (int i = 0; i < arr.length; i++) {
	        		    			pw.print(arr[i] + " ");
	        		    		}
	        		    		pw.println();
	        		    		return;
	        		    	}

	        		    	private static void pArray(boolean[] arr) {
	        		    		for (int i = 0; i < arr.length; i++) {
	        		    			pw.print(arr[i] + " ");
	        		    		}
	        		    		pw.println();
	        		    		return;
	        		    	}

	        		    	private static boolean isSpaceChar(int c) {
	        		    		if (filter != null)
	        		    			return filter.isSpaceChar(c);
	        		    		return isWhitespace(c);
	        		    	}

	        		    	private interface SpaceCharFilter {
	        		    		public boolean isSpaceChar(int ch);
	        		    	}

	    }

	        		           		    class Node{
	        		    	int to;
	        		    	long dist;
	        		    	Node(int to,long dist){
	        		    		this.to=to;
	        		    		this.dist=dist;
	        		    	}

	        		    }
	        		   /* class Pair implements Comparable<Pair>{

	    					int ele,ind;
	    					Pair(int ele,int ind){

	    						this.ele=ele;
	    						this.ind=ind;

	    					}
	    					@Override
	    					public int compareTo(Pair o) {

	    							return ele-o.ele;
	    					}
	    					public int hashCode() {
	    							//int hu = (int) (x ^ (x >>> 32));
	    							//int hv = (int) (y ^ (y >>> 32));
	    							//int hw = (int) (mass ^ (mass >>> 32));
	    							//return 31 * hu + hv ;
	    						return 0;
	    						}
	    						public boolean equals(Object o) {
	    							Pair other = (Pair) o;
	    						//	return x == other.x && y == other.y;
	    						return false;
	    						}
	    				}  */class Dsu{
		    		    	private int rank[], parent[] ,n;
		    		    	private static int[] parent1;
		    		    	Dsu(int size){
		    		    		this.n=size+1;
		    		    		rank=new int[n];
		    		    		//parent=new int[n];
		    		    		parent=new int[n];
		    		    	makeSet();

		    		    	}

		    		    	void makeSet(){
		    		    		for(int i=0;i<n;i++){
		    		    			parent[i]=i;
		    		    		}
		    		    	}

		    		    	int find(int x){
		    		    		if(parent[x]!=x){

		    		    			parent[x]=find(parent[x]);
		    		    		}
		    		    		return parent[x];
		    		    	}

		    		    	boolean union(int x,int y){
		    		    		int xRoot=find(x);
		    		    		int yRoot=find(y);

		    		    		if(xRoot==yRoot)
		    		    			return false;
		    		    		if(rank[xRoot]<rank[yRoot]){
		    		    		parent[xRoot]=yRoot;
		    		    		}else if(rank[yRoot]<rank[xRoot]){
		    		    			parent[yRoot]=xRoot;
		    		    		}else{
		    		    			parent[yRoot]=xRoot;
		    		    			rank[xRoot]++;
		    		    		}
		    		    		return true;
		    		    	}

		    		    }


import java.io.*;
import java.util.*;

public class Main {

	static InputReader in = new InputReader(System.in);
	static PrintWriter out = new PrintWriter(System.out);

	public static void main(String[] args) {

		long n = in.nextLong();
		long s = in.nextLong();

		if(diff(n) < s) {
			System.out.println(0);
			out.close();
			return;
		}

		long lo = 1;
		long hi = n;
		while(lo < hi) {
			long mid = lo + (hi - lo) / 2;
			if(diff(mid) >= s)
				hi = mid;
			else
				lo = mid + 1;
		}
		System.out.println(n - lo + 1);

		out.close();
	}

	static long diff(long n) {
		char[] ca = (n + "").toCharArray();
		int sum = 0;
		for(char c : ca)
			sum += (c - '0');
		return n - sum;
	}
}

class InputReader {

	private final InputStream stream;
	private final byte[] buf = new byte[8192];
	private int curChar, snumChars;

	public InputReader(InputStream st) {
		this.stream = st;
	}

	public int read() {
		if (snumChars == -1)
			throw new InputMismatchException();
		if (curChar >= snumChars) {
			curChar = 0;
			try {
				snumChars = stream.read(buf);
			} catch (IOException e) {
				throw new InputMismatchException();
			}
			if (snumChars <= 0)
				return -1;
		}
		return buf[curChar++];
	}

	public int nextInt() {
		int c = read();
		while (isSpaceChar(c)) {
			c = read();
		}
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		int res = 0;
		do {
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

	public long nextLong() {
		int c = read();
		while (isSpaceChar(c)) {
			c = read();
		}
		int sgn = 1;
		if (c == '-') {
			sgn = -1;
			c = read();
		}
		long res = 0;
		do {
			res *= 10;
			res += c - '0';
			c = read();
		} while (!isSpaceChar(c));
		return res * sgn;
	}

	public int[] nextIntArray(int n) {
		int a[] = new int[n];
		for (int i = 0; i < n; i++) {
			a[i] = nextInt();
		}
		return a;
	}

	public String readString() {
		int c = read();
		while (isSpaceChar(c)) {
			c = read();
		}
		StringBuilder res = new StringBuilder();
		do {
			res.appendCodePoint(c);
			c = read();
		} while (!isSpaceChar(c));
		return res.toString();
	}

	public String nextLine() {
		int c = read();
		while (isSpaceChar(c))
			c = read();
		StringBuilder res = new StringBuilder();
		do {
			res.appendCodePoint(c);
			c = read();
		} while (!isEndOfLine(c));
		return res.toString();
	}

	public boolean isSpaceChar(int c) {
		return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
	}

	private boolean isEndOfLine(int c) {
		return c == '\n' || c == '\r' || c == -1;
	}

}


import java.util.Scanner;

public class c {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		long n = scan.nextLong();
		long s = scan.nextLong();
		scan.close();
		long start = s - s % 10;
		while (start <= n && !isBig(start, s)) {
			start += 10;
		}
		if (start > n) {
			System.out.println(0);
		} else {
			System.out.println(n - start + 1);
		}
	}

	private static boolean isBig(long a, long s) {
		char[] digits = ("" + a).toCharArray();
		int counter = 0;
		for (int i = 0; i < digits.length; i++) {
			counter += digits[i] - '0';
		}
		return a - counter >= s;
	}

}


import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.PrintStream;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Wolfgang Beyer
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            long n = in.nextLong();
            long s = in.nextLong();

            if (n - digitSum(n) < s) {
                out.println(0);
                return;
            }

            long left = 0;
            long right = n;
            while (left < right) {
                long mid = left + (right - left) / 2;
                if (mid - digitSum(mid) >= s) { // if condition(mid) == true
                    right = mid;
                } else {
                    left = mid + 1;
                }
            }
            out.println(n - left + 1);
        }

        long digitSum(long a) {
            long result = 0;
            while (a > 0) {
                result += a % 10;
                a /= 10;
            }
            return result;
        }

    }

    static class InputReader {
        private static BufferedReader in;
        private static StringTokenizer tok;

        public InputReader(InputStream in) {
            this.in = new BufferedReader(new InputStreamReader(in));
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public String next() {
            try {
                while (tok == null || !tok.hasMoreTokens()) {
                    tok = new StringTokenizer(in.readLine());
                    //tok = new StringTokenizer(in.readLine(), ", \t\n\r\f"); //adds commas as delimeter
                }
            } catch (IOException ex) {
                System.err.println("An IOException was caught :" + ex.getMessage());
            }
            return tok.nextToken();
        }

    }
}


import java.io.*;

import java.util.*;

public class Solution {

    public static void main(String[] args) {
       Scanner scanner = new Scanner(System.in);

       long n =   scanner.nextLong();
       long s =   scanner.nextLong();
       long myLong = s;
       long count =0;
      while(true){
    	  if(myLong>n){
    		  break;
    	  }
    	  char[] num = (""+myLong).toCharArray();
		int sum = 0;
			for (int j = 0; j < num.length; j++)
				sum += num[j] - '0';

    	  if(myLong- sum>=s){
    		  //count++;
    		  break;
    	  }

    	  myLong++;
      }
      System.out.println(Math.max(n-myLong+1,0));
        scanner.close();
    }
}


import java.util.Scanner;

public class ReallyBigNumbers {
	public static void main(String[] args) {
		@SuppressWarnings("resource")
		Scanner sc = new Scanner(System.in);
		long n = sc.nextLong(); // max
		long s = sc.nextLong(); // differential
		long bigNums = 0;
		long inARow = 0;
		for (long i = s; i <= n; i++) {
			if (inARow == 9) {
				bigNums += (n - i+1);
				break;
			} else {
				if (i >= s + digitSum(i)) {
					bigNums++;
					inARow++;
				} else {
					inARow = 0;
				}
			}
		}
		System.out.println(bigNums);
	}

	public static long digitSum(long a) {
		long sum = a % 10;
		if (9 < a) {
			a /= 10;
			sum += digitSum(a);
		}
		return sum;
	}
}


import java.util.Arrays;
import java.util.Scanner;

public class P817C
{
	public static void main(String[] args)
	{
		Scanner scan = new Scanner(System.in);
		long n = scan.nextLong();
		long s = scan.nextLong();
		long ans = 0;
		if (s > n)
		{
			System.out.println(0);
			return;
		}
		if (n > s+200)
		{
			ans += n-(s+200);
			n = s+200;
		}
		for (long i = s; i <= n; i++)
		{
			char[] num = (""+i).toCharArray();
			int sum = 0;
			for (int j = 0; j < num.length; j++)
				sum += num[j] - '0';
			if (i - sum >= s)
				ans++;
		}
		System.out.println(ans);
	}
}