import math
a,b,n = map(int,input().split())
maxx = n//b
ans = 0
for i in range(min(maxx,10**8)):
    x = b*(maxx-i)-1
    ans = max(math.floor(a*x/b)-a*(math.floor(x/b)),ans)
ans = max(math.floor(a*n/b)-a*(math.floor(n/b)),ans)
print(ans)


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

public class Main {
    public static void main(String[] args) {
        FastReader s = new FastReader();
        long a=s.nextLong();
        long b=s.nextLong();
        long n=s.nextLong();
        System.out.println((a*Math.min(n,b-1))/b);
    }

    private static boolean isPrime(int n) {
        if (n == 2)
            return true;
        else if ((n % 2 == 0 && n > 2) || n < 2)
            return false;
        else {
            for (int i = 3; i <= (int) Math.sqrt(n); i += 2) {
                if (n % i == 0)
                    return false;
            }
            return true;
        }
    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                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());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }

}


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

public class Main {

	private static void solve(){
		//Implement solution here.
		long A = nl();
		long B = nl();
		long N = nl();
		long result = -1L;
		long x = Math.min(N, B - 1);
		result = (A * x / B) - A * (x / B);
		//result = Math.max(v ,result);

		System.out.println(result);
	}

	//Switch input source (stdin/file)
	private static BufferedReader br;
	public static void main(String[] args){
		br = new BufferedReader(new InputStreamReader(System.in));
		String debugDataPath = System.getenv("DD_PATH");
		if(debugDataPath != null){
			try{
				br = new BufferedReader(new InputStreamReader(new FileInputStream(new File(debugDataPath))));
			}catch(Exception e){
				throw new RuntimeException(e);
			}
		}
		boolean hasNext = true;
		while(hasNext){
			solve();
			try{
				br.mark(1);
				if(br.read() > 0){
					br.reset();
					System.out.println("---");
				} else {
					hasNext = false;
				}
			}catch(Exception e){
				throw new RuntimeException(e);
			}
		}
	}

	//Input read utility
	private static StringTokenizer tokenizer = null;
	public static String next() {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(br.readLine());
			} catch (Exception e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	}
	//Get next single int
	private static int ni() {
		return Integer.parseInt(next());
	}
	//Get next single long
	private static long nl() {
		return Long.parseLong(next());
	}
	//Get next single double
	private static double nd() {
		return Double.parseDouble(next());
	}
	//Get next int array from one line
	private static int[] na(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = ni();
		return a;
	}
	//Get next char array from one line
	private static char[] ns() {
		return next().toCharArray();
	}
	//Get next long array from one line
	private static long[] nal(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = nl();
		return a;
	}
}


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

public class Main {

    public static void main(String[] args) throws Exception {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        String[] split = in.readLine().split(" ");
        int A = Integer.parseInt(split[0]);
        long B = Long.parseLong(split[1]);
        long N = Long.parseLong(split[2]);
        long X = -1;
        if(N < B) {
            X = N;
        } else {
            X = B - 1;
        }
        System.out.println((long)(Math.floor((A * X) / B) - A * Math.floor(X / B)));
    }
}


import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long a = sc.nextLong();
        long b = sc.nextLong();
        long n = sc.nextLong();
        long ans = 0;
        for (long i = 1; i <= n; i++) {
            long tmp1 = (a * i) / b;
            long tmp2 = a * (i / b);
            long tmp3 = tmp1 - tmp2;
            ans = Math.max(ans, tmp3);
        }
        System.out.println(ans);
    }
}


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

public class Main {
    public static void main(String [] args) throws IOException{
        FastScanner sc=new FastScanner();
        long a=sc.nextLong();
        long b=sc.nextLong();
        long n=sc.nextLong();

        long l=1,r=n;
        long ans=Long.MIN_VALUE;

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

            double x=Math.floor(((double)a*mid)/(double)b);
            double y=(double)a*Math.floor(((double)mid/(double)b));

            if(((long)(x+y))>=ans){
                l=mid+1;
                ans=(long)(x+y);
            }
            else{
                r=mid-1;
            }
        }

        System.out.println(ans);
    }
}

class FastScanner{
    private int BUFFER_SIZE = 1 << 16;

   private  DataInputStream din;

   private  byte[] buffer;

   private int bufferPointer, bytesRead;

   public FastScanner() {
       din = new DataInputStream(System.in);
       buffer = new byte[BUFFER_SIZE];
       bufferPointer = bytesRead = 0;
   }

   public FastScanner( String file_name) throws IOException {
       din = new DataInputStream(new FileInputStream(file_name));
       buffer = new byte[BUFFER_SIZE];
       bufferPointer = bytesRead = 0;
   }

   public String readLine() throws IOException {
        byte[] buf = new byte[64];
       int cnt = 0, c;
       while ((c = read()) != -1) {
           if (c == '\n')
               break;
           buf[cnt++] = (byte) c;
       }
       return new String(buf, 0, cnt);
   }

   public String next() throws IOException{

       byte c = read();
       while(Character.isWhitespace(c)){
           c = read();
       }

        StringBuilder builder = new StringBuilder();
       builder.append((char)c);
       c = read();
       while(!Character.isWhitespace(c)){
           builder.append((char)c);
           c = read();
       }

       return builder.toString();
   }

   public int nextInt() throws IOException {
       int ret = 0;
       byte c = read();
       while (c <= ' ')
           c = read();
        boolean neg = (c == '-');
       if (neg)
           c = read();
       do {
           ret = ret * 10 + c - '0';
       } while ((c = read()) >= '0' && c <= '9');

       if (neg)
           return -ret;
       return ret;
   }

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

   public long nextLong() throws IOException {
       long ret = 0;
       byte c = read();
       while (c <= ' ')
           c = read();
        boolean neg = (c == '-');
       if (neg)
           c = read();
       do {
           ret = ret * 10 + c - '0';
       } while ((c = read()) >= '0' && c <= '9');
       if (neg)
           return -ret;
       return ret;
   }

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

   public char nextChar() throws IOException{
       byte c = read();
       while(Character.isWhitespace(c)){
           c = read();
       }
       return (char) c;
   }

   public double nextDouble() throws IOException {
       double ret = 0, div = 1;
       byte c = read();
       while (c <= ' ')
           c = read();
        boolean neg = (c == '-');
       if (neg)
           c = read();

       do {
           ret = ret * 10 + c - '0';
       } while ((c = read()) >= '0' && c <= '9');

       if (c == '.') {
           while ((c = read()) >= '0' && c <= '9') {
               ret += (c - '0') / (div *= 10);
           }
       }

       if (neg)
           return -ret;
       return ret;
   }

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

   private void fillBuffer() throws IOException {
       bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
       if (bytesRead == -1)
           buffer[0] = -1;
   }

   private byte read() throws IOException {
       if (bufferPointer == bytesRead)
           fillBuffer();
       return buffer[bufferPointer++];
   }

   public void close() throws IOException {
       if (din == null)
           return;
       din.close();
   }

}


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

public class Main {
    public static void main(String [] args) throws IOException{
        FastScanner sc=new FastScanner();
        long a=sc.nextLong();
        long b=sc.nextLong();
        long n=sc.nextLong();

        long l=1,r=n;
        long ans=Long.MIN_VALUE;

        while(l<=r){
            long mid=(l+r)/2;
            long x=(a*mid)/b;
            long y=a*(mid/b);

            if((x+y)>=ans){
                l=mid+1;
                ans=(x+y);
            }
            else{
                r=mid-1;
            }
        }

        System.out.println(ans);
    }
}

class FastScanner{
    private int BUFFER_SIZE = 1 << 16;

   private  DataInputStream din;

   private  byte[] buffer;

   private int bufferPointer, bytesRead;

   public FastScanner() {
       din = new DataInputStream(System.in);
       buffer = new byte[BUFFER_SIZE];
       bufferPointer = bytesRead = 0;
   }

   public FastScanner( String file_name) throws IOException {
       din = new DataInputStream(new FileInputStream(file_name));
       buffer = new byte[BUFFER_SIZE];
       bufferPointer = bytesRead = 0;
   }

   public String readLine() throws IOException {
        byte[] buf = new byte[64];
       int cnt = 0, c;
       while ((c = read()) != -1) {
           if (c == '\n')
               break;
           buf[cnt++] = (byte) c;
       }
       return new String(buf, 0, cnt);
   }

   public String next() throws IOException{

       byte c = read();
       while(Character.isWhitespace(c)){
           c = read();
       }

        StringBuilder builder = new StringBuilder();
       builder.append((char)c);
       c = read();
       while(!Character.isWhitespace(c)){
           builder.append((char)c);
           c = read();
       }

       return builder.toString();
   }

   public int nextInt() throws IOException {
       int ret = 0;
       byte c = read();
       while (c <= ' ')
           c = read();
        boolean neg = (c == '-');
       if (neg)
           c = read();
       do {
           ret = ret * 10 + c - '0';
       } while ((c = read()) >= '0' && c <= '9');

       if (neg)
           return -ret;
       return ret;
   }

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

   public long nextLong() throws IOException {
       long ret = 0;
       byte c = read();
       while (c <= ' ')
           c = read();
        boolean neg = (c == '-');
       if (neg)
           c = read();
       do {
           ret = ret * 10 + c - '0';
       } while ((c = read()) >= '0' && c <= '9');
       if (neg)
           return -ret;
       return ret;
   }

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

   public char nextChar() throws IOException{
       byte c = read();
       while(Character.isWhitespace(c)){
           c = read();
       }
       return (char) c;
   }

   public double nextDouble() throws IOException {
       double ret = 0, div = 1;
       byte c = read();
       while (c <= ' ')
           c = read();
        boolean neg = (c == '-');
       if (neg)
           c = read();

       do {
           ret = ret * 10 + c - '0';
       } while ((c = read()) >= '0' && c <= '9');

       if (c == '.') {
           while ((c = read()) >= '0' && c <= '9') {
               ret += (c - '0') / (div *= 10);
           }
       }

       if (neg)
           return -ret;
       return ret;
   }

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

   private void fillBuffer() throws IOException {
       bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE);
       if (bytesRead == -1)
           buffer[0] = -1;
   }

   private byte read() throws IOException {
       if (bufferPointer == bytesRead)
           fillBuffer();
       return buffer[bufferPointer++];
   }

   public void close() throws IOException {
       if (din == null)
           return;
       din.close();
   }

}


#include<stdio.h>
#include<algorithm>

using namespace std;

long long inp_n1, inp_n2, inp_n3, i1;

long long readNumber() {
	long long temp_func;
	scanf("%lld", &temp_func);
	return temp_func;
};
long long printNumber(long long temp_func) {
	printf("%lld", temp_func);
	return 0;
};

long long caler() {

	return inp_n1 * min(inp_n2 - 1, inp_n3) / inp_n2;

};

int main() {

	inp_n1 = readNumber();

	inp_n2 = readNumber();

	inp_n3 = readNumber();

	printNumber(caler());

}


#include<stdio.h>
int main()
{
	int a;
	long long b,n;
	scanf("%d%lld%lld",&a,&b,&n);
	if(n>=b)
	{
		printf("%lld\n",(long long)(a*(b-1)/b));

	 }
	else
	{
		printf("%lld\n",(long long)(a*n/b));
	}

	return 0;
}


#include <cstdio>

long long a, b, n;

int main() {
    scanf("%lld%lld%lld", &a, &b, &n);
    long long x = n < b ? n : b - 1;
    printf("%lld\n", a * x / b - x / b * a);
    return 0;
}


#include <iostream>
#include <cmath>
using namespace std;
int main(){
    long long a, b, n, tmp, ans=0;
    cin >> a >> b >> n;

    for(int i=0; i<=n; i++){
        tmp = floor( a*i / b ) - a * floor( i / b );
        ans = max(tmp,ans);
    }
    cout << ans << endl;
    return 0;
}


#include <iostream>
#include <cmath>
using namespace std;
int main(){
    long long a, b, n;
    cin >> a >> b >> n;
    long long ans = floor( a*n / b ) - a * floor( n / b );
    cout << ans << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define int long long

signed main() {
  int A,B,N;
  cin >> A >> B >> N;
  cout << N/(abs(A-B)) << endl;
}


#include<stdio.h>
int main(void)
{
  long long a,b,n,x;
  scanf("%lld %lld %lld",&a,&b,&n);
  if(b>n){
    x=n;
  }else{
    x=b-1;
  }
  printf("%lld\n",((a*x)/b)-(a*(x/b)));
  return 0;
}


#include<stdio.h>

int main()
{
  long long int a,b,n;
  scanf("%lld %lld %lld",&a,&b,&n);
  printf("%lld",((n<b)?(a*n/b):(a*(b-1)/b)));
}


#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <limits.h>
#include <math.h>
typedef long long ll;

int main()
{
	ll A,B,N;
	scanf("%lld %lld %lld", &A,&B,&N);
	ll i = N;
	ll x;
	ll n;
	ll max = LLONG_MIN;
	ll sum;
	while (i >= N - 2)
	{
		sum = (A*i/B) - A * (i/B);
		if (sum >= max)
		{
			x = i;
			max = sum;
		}
		i--;
	}
	x = B - 1;
	if (N >= B - 1 && (A*x/B) - A * (x/B) > max)
		max = (A*x/B) - A * (x/B);
	printf("%lld\n", max);
	return (0);
}


#include <stdio.h>
#include <math.h>
int main(void){
  long long a,b,n,k,i;
  scanf("%lld %lld %lld",&a,&b,&n);
  k= floor((long double)a*n/b);
  if(b==1){
    printf("0");
    return 0;
    } else if(n<b) {
      printf("%lld",k);
      return 0;
    }else{
      for(i=n;i>=n-b;i--){
        if(i%b==b-1){
          k= floor((long double)a*(i)/b)-floor((long double)i/b);
          printf("%lld",k);
          return 0;
        }
      }
    }
}


#include <stdio.h>
#include <math.h>
int main(void){
  long long a,b,n,k,i;
  scanf("%lld %lld %lld",&a,&b,&n);
  k= floor((long double)a*n/b);
    if(n<b) {
      printf("%lld",k);
      return 0;
    }else{
      for(i=n;i>=n-b;i--){
        if(i%b==b-1){
          k= floor((long double)a*(i)/b)-floor((long double)i/b);
          printf("%lld",k);
          return 0;
        }
      }
    }
}


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
int acs(const void *a, const void *b) {
  return *(int*)a - *(int*)b;
} /* 1,2,3,4.. */
int des(const void *a, const void *b) {
  return *(int*)b - *(int*)a;
} /* 8,7,6,5.. */
int cmp_char(const void *a, const void *b) {
  return *(char*)a - *(char*)b;
} /* a,b,c,d.. */
int cmp_str(const void *a, const void *b) {
  return strcmp(*(const char **)a, *(const char **)b);
} /* aaa,aab.. */
#define min(a,b) (a < b ? a : b)
#define max(a,b) (a > b ? a : b)
#define rep(i, l, r) for (int i = l; i < r; i++)
#define MAX 1000000000001
#define MOD 1000000007
#define INF 1000000009
typedef long long int lli;

int main(void) {
	long long A, B, N;
	scanf("%lld %lld %lld", &A, &B, &N);

	long long max = 0;
	for (long long x = 1; x <= N; x++) {
		long long tmp = A * x / B - A * (x / B);
		max = max(tmp, max);
	}
	printf("%lld\n", max);
  return 0;
}


const main = (str) => {
    const [A,B,N] = str.split(' ');
    const b = B>N ? N : B-1;
    const result = Math.floor(A*b/B);
    console.log(result);
};

main(require('fs').readFileSync('/dev/stdin', 'utf8'));


function main(input) {
  let a,b,n;
  [a, b, n] = input[0].trim().split(" ").map(i => parseInt(i));

  let max = -100000000;
  if(n>=b){
    max = Math.floor(a*(b-1)/b) - (a * Math.floor((b-1)/b));
  }else{
    max = Math.floor(a*n/b) - (a * Math.floor(n/b));
  }
  console.log(max);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8').trim().split("\n"));


function Main(input){
  input = input.split(' ').map(x=>BigInt(x));
  var a = input[0];
  var b = input[1];
  var n = input[2];
  if (b==1){
    var max = 0n;
  }else if (n<b){
    var max = a*n/b - a*(n/b);
  }else{
    var border = (n+1n)/b;
    var t = 1n;
    var max = 0n;
    for (let t = 1n;t<=border;t++){
      var now = a*(b*t-1n)/b - a*((b*t-1n)/b);
      if (now > max){
        max = now;
      }
    }
  }
  console.log(max.toString())
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));


const input = require("fs").readFileSync("/dev/stdin", "utf8")
const lines = input.split('\n')
const [A, B, N] = lines[0].split(' ').map(Number)

let ans = 0
for (let x = 0; x <= N; x++) {
    const res = Math.floor(A * x / B) - A * Math.floor(x / B)
    ans = Math.max(ans, res)
}

console.log(ans)


function MainD(input){
    const [A, B, N] = input.split(' ');
    const answer1 = Math.floor((A * N)/B) - A *  Math.floor(N/B);
    const answer2 = Math.floor((A * (N-1))/B) - A *  Math.floor((N-1)/B);
    console.log(answer1 > answer2 ? answer1 : answer2);
}
MainD(require("fs").readFileSync("/dev/stdin", "utf8").trim());


function MainD(input){
    const [A, B, N] = input.split(' ');
    const answer = Math.floor((A * N)/B) - A *  Math.floor(N/B);
    console.log(answer);
}
MainD(require("fs").readFileSync("/dev/stdin", "utf8").trim());


package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func max(a int, b int) int {
	if a >= b {
		return a
	}
	return b
}

func solve(A int, B int64, N int64) int64 {
	var x int64 = B - 1
	if x > N {
		x = N
	}
	return (int64(A) * x / B) - (int64(A) * (x / B))
}

var sc = bufio.NewScanner(os.Stdin)

func nextLine() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	sc.Scan()
	hoge := sc.Text()
	i, e := strconv.Atoi(hoge)
	if e != nil {
		panic(e)
	}
	return i
}

func nextInt64() int64 {
	sc.Scan()
	hoge := sc.Text()
	i, e := strconv.ParseInt(hoge, 0, 64)
	if e != nil {
		panic(e)
	}
	return i
}

func main() {
	sc.Split(bufio.ScanWords)
	A, B, N := nextInt(), nextInt64(), nextInt64()
	fmt.Println(solve(A, B, N))
}


package main

import "fmt"

func main() {
	var a, b, n int
	fmt.Scan(&a, &b, &n)

	x := min(n, b-1)
	v := f(a, b, x)
	fmt.Println(v)
}

func f(a, b, x int) int {
	return (a * x / b) - a*(x/b)
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}


package main

import (
	"fmt"
	"math"
)

func min(x, y int) int {
	if x < y {
		return x
	}
	return y
}

func main() {
	var a, b, n float64
	fmt.Scan(&a, &b, &n)

	x := float64(min(int(b-1), int(n)))
	fmt.Println(int(math.Floor(a*x/b)) - int(a)*int(math.Floor(x/b)))
}


package main

import (
	"fmt"
	"math"
)

func main() {
	// Code for D - Floor Function
	var A, B int
	var N int
	fmt.Scan(&A, &B, &N)

	/*
		var ans int
		var max int

		for i := 0; i <= B-1; i++ {
			ans = int(math.Ceil(float64((A * i) / B)))
			if max < ans {
				max = ans
			}
		}
	*/

	//fmt.Println(max)
	fmt.Println(int(math.Min(math.Ceil(float64((A*N)/B)), math.Ceil(float64((A*B-1)/B)))))
}


package main

import (
	"fmt"
	"math"
)

func main() {
	// Code for D - Floor Function
	var A, B int
	var N int
	fmt.Scan(&A, &B, &N)

	var ans int
	var max int
	var temp int
	for i := 1; i <= N; i++ {
		ans = int(math.Ceil(float64((A*i)/B))) - A*int(math.Ceil(float64(i/B)))
		if temp > ans {
			break
		}

		if max < ans {
			max = ans
		}
		temp = ans
		//fmt.Println(ans)
	}

	fmt.Println(max)
}


package main

import (
	"fmt"
	"math"
)

func main() {
	// Code for D - Floor Function
	var A, B int
	var N int
	fmt.Scan(&A, &B, &N)

	var ans int
	var max int
	for i := 1; i <= N; i++ {
		ans = int(math.Ceil(float64((A*i)/B))) - A*int(math.Ceil(float64(i/B)))
		if max < ans {
			max = ans
		}
	}

	fmt.Println(max)
}


A,B,N=$<.read.split.map(&:to_i)

if N < B
    x = N
else
    x = N/B*B-1
end
ret = (A*x)/B - A*(x/B)
puts ret


def func(a, b, x)
  (a*x)/b - a*(x/b)
end

a, b, n = gets.strip.split.map(&:to_i)
p func(a, b, [n, b-1].min)


a, b, n = gets.chomp.split.map(&:to_i)

x = [b - 1, n].min
b = b.to_f

t = (a * x / b).floor - a * (x / b).floor

puts t


a, b, n = gets.split(" ").map &:to_i
x = 1
ans = 0
while x <= b && x <= n
  max = ((a*x)/b).floor - a*(x/b).floor
  if ans < max
    ans = max
  end
  x += 1
end
puts ans


a,b,n = gets.split.map &:to_i

puts (0..n).map{|x|(a.to_r * x/ b).to_i - a * (x.to_r/b).to_i}.max


result=[]
a,b,n=gets.split.map(&:to_i)

for i in 1..n

    v=(a*i).div(b)
    v=v.to_i
    vv=i.div(b)
    vv=vv.to_i
    answer=v-a*vv
    if i==1
    result[i-1]=answer
    elsif answer>=result[i-2]
    result[i-1]=answer
    elsif answer<result[i-2]
    p result[i-2]
    exit
    end
end
 p result[-1]


#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

use std::cmp::Ordering;
use std::cmp;
use std::cmp::min;
use std::collections::BTreeMap;
use std::process;
use std::cmp::Ord;
use std::collections::HashMap;
use std::collections::HashSet;
use std::collections::VecDeque;
use std::collections::BTreeSet;
use std::mem;
use std::collections::BinaryHeap;
use std::hash::{Hash, Hasher};

// ---------- begin ModInt ----------

#[derive(Clone, Copy)]
struct ModInt(usize);
impl std::ops::Add for ModInt {
    type Output = ModInt;
    fn add(self, rhs: ModInt) -> Self::Output {
        let mut d = self.0 + rhs.0;
        if d >= MODu {
            d -= MODu;
        }
        ModInt(d)
    }
}

impl std::ops::AddAssign for ModInt {
    fn add_assign(&mut self, rhs: ModInt) {
        *self = *self + rhs;
    }
}

impl std::ops::Sub for ModInt {
    type Output = ModInt;
    fn sub(self, rhs: ModInt) -> Self::Output {
        let mut d = self.0 + MODu - rhs.0;
        if d >= MODu {
            d -= MODu;
        }
        ModInt(d)
    }
}

impl std::ops::SubAssign for ModInt {
    fn sub_assign(&mut self, rhs: ModInt) {
        *self = *self - rhs;
    }
}

impl std::ops::Mul for ModInt {
    type Output = ModInt;
    fn mul(self, rhs: ModInt) -> Self::Output {
        ModInt((self.0 as u64 * rhs.0 as u64 % MODu as u64) as usize)
    }
}

impl std::ops::MulAssign for ModInt {
    fn mul_assign(&mut self, rhs: ModInt) {
        *self = *self * rhs;
    }
}

impl std::ops::Neg for ModInt {
    type Output = ModInt;
    fn neg(self) -> Self::Output {
        ModInt(if self.0 == 0 {0} else {MODu - self.0})
    }
}

impl std::fmt::Display for ModInt {
    fn fmt<'a>(&self, f: &mut std::fmt::Formatter<'a>) -> std::fmt::Result {
        write!(f, "{}", self.0)
    }
}

impl std::str::FromStr for ModInt {
    type Err = std::num::ParseIntError;
    fn from_str(s: &str) -> Result<Self, Self::Err> {
        let val = s.parse::<usize>()?;
        Ok(ModInt::new(val))
    }
}
impl PartialEq for ModInt {
    fn eq(&self, other: &Self) -> bool {
        self.0 == other.0
    }
}
impl Hash for ModInt {
    fn hash<H: Hasher>(&self, state: &mut H) {
        self.0.hash(state);
        self.0.hash(state);
    }
}
impl Eq for ModInt {}
#[allow(dead_code)]
impl ModInt {
    pub fn new(n: usize) -> ModInt {
        ModInt(n % MODu)
    }
    pub fn zero() -> ModInt {
        ModInt(0)
    }
    pub fn one() -> ModInt {
        ModInt(1)
    }
    pub fn pow(self, mut n: usize) -> ModInt {
        let mut t = ModInt::one();
        let mut s = self;
        while n > 0 {
            if n & 1 == 1 {
                t *= s;
            }
            s *= s;
            n >>= 1;
        }
        t
    }
    pub fn inv(self) -> ModInt {
        self.pow(MODu - 2)
    }
}
// ---------- end ModInt ----------

/// Equivalent to std::lowerbound and std::upperbound in c++
pub trait BinarySearch<T> {
    fn lower_bound(&self, x:&T) -> usize;
    fn upper_bound(&self, x:&T) -> usize;
}

impl<T: Ord> BinarySearch<T> for VecDeque<T>{
    fn lower_bound(&self, x: &T) -> usize {
        let mut low = 0;
        let mut high = self.len();

        while low != high {
            let mid = (low + high) / 2;
            match self[mid].cmp(x) {
                Ordering::Less => {
                    low = mid + 1;
                }
                Ordering::Equal | Ordering::Greater => {
                    high = mid;
                }
            }
        }
        low
    }

    fn upper_bound(&self, x: &T) -> usize {
        let mut low = 0;
        let mut high = self.len();

        while low != high {
            let mid = (low + high) / 2;
            match self[mid].cmp(x) {
                Ordering::Less | Ordering::Equal => {
                    low = mid + 1;
                }
                Ordering::Greater => {
                    high = mid;
                }
            }
        }
        low
    }
}
impl<T: Ord> BinarySearch<T> for [T]{
    fn lower_bound(&self, x: &T) -> usize {
        let mut low = 0;
        let mut high = self.len();

        while low != high {
            let mid = (low + high) / 2;
            match self[mid].cmp(x) {
                Ordering::Less => {
                    low = mid + 1;
                }
                Ordering::Equal | Ordering::Greater => {
                    high = mid;
                }
            }
        }
        low
    }

    fn upper_bound(&self, x: &T) -> usize {
        let mut low = 0;
        let mut high = self.len();

        while low != high {
            let mid = (low + high) / 2;
            match self[mid].cmp(x) {
                Ordering::Less | Ordering::Equal => {
                    low = mid + 1;
                }
                Ordering::Greater => {
                    high = mid;
                }
            }
        }
        low
    }
}

fn matmul(A:&Vec<Vec<i64>>, B:&Vec<Vec<i64>>) -> Vec<Vec<i64>>{
    let mut C = vec![vec![0;B[0].len()];A.len()];
    for i in 0..A.len(){
        for k in 0..B.len(){
            for j in 0..B[0].len(){
                C[i][j] += A[i][k]*B[k][j];
                C[i][j] %= MOD;
            }
        }
    }
    return C;
}
fn matpow(A:&mut Vec<Vec<i64>>, n:usize) -> Vec<Vec<i64>>{
    let mut B = vec![vec![0;A.len()];A.len()];
    for i in 0..A.len(){
        B[i][i] = 1;
    }
    let mut n = n;
    let mut tmp = A.clone();
    while(n>0){
        if n&1 == 1{B = matmul(&B, &tmp);}
        tmp = matmul(&tmp, &tmp);
        n>>=1;
    }
    return B;
}

fn divisor(n:usize) -> Vec<usize>{
    let mut res:Vec<usize> = Vec::new();
    for i in 1..n+1{
        if i*i>n{break;}
        if n%i == 0{
            res.push(i);
            if i != n/i{
                res.push(n/i);
            }
        }
    }
    res
}
struct UnionFind{
    par:Vec<usize>,
    rank:Vec<usize>,
    size:Vec<usize>,
    size_edge:Vec<usize>,
}
impl UnionFind{
    fn init(n:usize) -> UnionFind{
        let mut par = vec![0;n];
        for i in 0..n{
            par[i] = i;
        }
        UnionFind{
            par:par,
            rank:vec![0;n],
            size:vec![1;n],
            size_edge:vec![0;n],
        }
    }
    fn find(&mut self, x:usize) ->usize{
        if(self.par[x] == x){
            x
        }
        else{
            let p = self.par[x];
            let res = self.find(p);
            self.par[x] = res;
            res
        }
    }
    fn same(&mut self, a:usize, b:usize)->bool{
        self.find(a) == self.find(b)
    }
    fn unite(&mut self, a:usize, b:usize){
        let x = self.find(a);
        let y = self.find(b);
        if x != y{
            if (self.rank[x] < self.rank[y]){
                self.par[x] = y;
                self.size[y] += self.size[x];
                self.size_edge[y] += self.size_edge[x];
                self.size_edge[y] += 1;
            }
            else{
                self.par[y] = x;
                self.size[x] += self.size[y];
                self.size_edge[x] += self.size_edge[y];
                self.size_edge[x] += 1;
                if(self.rank[x] == self.rank[y]){ self.rank[x]+=1;}
            }

        }
        else{
            self.size_edge[x] += 1;
        }
    }
    fn check_size(&mut self, a:usize) -> usize{
        let x = self.find(a);
        let s = self.size[x];
        s
    }
}
pub struct Scanner<R> {
    stdin: R,
}

impl<R: std::io::Read> Scanner<R> {
    pub fn read<T: std::str::FromStr>(&mut self) -> T {
        use std::io::Read;
        let buf = self
            .stdin
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b' ' || b == b'\n' || b == b'\r')
            .take_while(|&b| b != b' ' && b != b'\n' && b != b'\r')
            .collect::<Vec<_>>();
        std::str::from_utf8(&buf).unwrap()
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read()).collect()
    }
    pub fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
}
struct LazySegTree<BiOp> {
    n: usize,
    val: Vec<i64>,
    ma:Vec<i64>,
    op: BiOp,
    e: i64,
    upe:i64,
    inf:i64,
}

impl<BiOp> LazySegTree<BiOp>
    where BiOp: Fn(i64, i64) -> i64{
    pub fn new(n_: usize, op: BiOp, e: i64, upe:i64, inf:i64) -> Self {
        let mut n = 1;
        while n < n_ { n *= 2; } // n is a power of 2

        LazySegTree {n: n, val: vec![e; 2 * n ], ma:vec![upe;2*n], op: op, e: e, upe:upe, inf:inf}
    }
    pub fn query(&self, x:usize, y:usize, l:usize, r:usize, k:usize) -> i64 {
        if (r<=x || y<=l) {return self.inf;}
        if (x<=l && r<=y) {return self.ma[k];}
        let mut L = self.query(x,y,l,(l+r)/2, k*2);
        let mut R = self.query(x,y,(l+r)/2,r, k*2+1);
        return self.val[k] + (self.op)(L, R);

    }

    pub fn update(&mut self, x:usize, y:usize, v:i64, l:usize,r:usize, k:usize) {
        if (l>=r) {return;}
        if (x<=l && r<=y){
            self.val[k]+=v;
            self.ma[k]+=v;
        }
        else if(l<y && x<r){
            self.update(x, y, v, l, (l+r)/2, k*2);
            self.update(x,y,v,(l+r)/2,r, k*2+1);
            self.ma[k] = self.val[k] + (self.op)(self.ma[k*2], self.ma[k*2+1]);
        }
    }
}
fn modinv(a:ModInt)->ModInt{
    let mut a = a.0 as usize;
    let mut b = MODu as i64;
    let mut u = 1 as i64;
    let mut v = 0 as i64;
    let mut a = a as i64;
    let mut m = MODu as i64;
    while(b>0){
        let mut t = a/b;
        a -= t*b;
        mem::swap(&mut a, &mut b);
        u-=t*v;
        mem::swap(&mut u, &mut v);
    }
    u%=m;
    if u<0{u+=m;}
    return ModInt(u as usize);

}
fn modpow(x:ModInt, n:ModInt) -> ModInt{
        let mut ans = ModInt(1);
        let mut n = n.0 as usize;
        let mut x = x;
        while(n != 0){
            if (n&1 == 1){ans = ans*x;}
            x = x*x;
            n = n>>1;
        }
        ans
}
fn comb(a:usize, b:usize,  fac:&Vec<ModInt>, ifac:&Vec<ModInt>)->ModInt{
        let mut a = a;
        let mut b = b;
        if a == 0 && b == 0{return ModInt(1);}
        if a<b || a<0{return ModInt(0);}
        let mut tmp = ifac[a-b]*ifac[b];
        return tmp * fac[a];
}

fn invs()->(Vec<ModInt>, Vec<ModInt>){
    let mut fac = vec![ModInt(0);300001];
    let mut ifac = vec![ModInt(0);300001];
    fac[0] = ModInt(1);
    ifac[0] = ModInt(1);
    for i in 0..300000{

        fac[i+1] = fac[i] * ModInt(i+1);
        ifac[i+1] = ifac[i] * modpow(ModInt(i+1), ModInt(MODu - 2));
    }
    (fac, ifac)
}

struct ConvexHallTrick {
    Q: Vec<(i64, i64)>,
}

impl ConvexHallTrick{
    pub fn new() -> Self {

        ConvexHallTrick {Q: Vec::new()}
    }
    pub fn calc(&self, p:(i64, i64), x:i64)->i64{
        return p.0 * x + p.1;
    }
    pub fn dodo(& self, A:(i64, i64), B:(i64, i64), C:(i64, i64)) -> bool{
        //max or min
        (A.1 - C.1) * (B.0 - A.0) <= (A.1 - B.1)*(C.0 - A.0)
    }
    pub fn add(&mut self, a:i64, b:i64){
        self.Q.push((a, b));
        let mut v = self.Q.len();
        while(v >=3 && self.dodo(self.Q[v-3], self.Q[v-2], self.Q[v-1])){
            self.Q[v-2] = self.Q[v-1];
            self.Q.pop();
            v = self.Q.len();
        }
    }
    pub fn query(& self, x:i64) -> i64{
        let mut L = -1;
        let mut R = (self.Q.len() - 1) as i64;
        while(R-L>1){
            let mut m = (L+R)/2;
            if self.calc(self.Q[m as usize], x)>=self.calc(self.Q[m as usize+1], x){
                L=m;
            }
            else{
                R=m;
            }

        }
        return self.calc(self.Q[R as usize], x);
    }
}
#[derive(Eq, PartialEq, Clone, Debug)]
pub struct Rev<T>(pub T);
impl<T: PartialOrd> PartialOrd for Rev<T> {
    fn partial_cmp(&self, other: &Rev<T>) -> Option<Ordering> {
        other.0.partial_cmp(&self.0)
    }
}
impl<T: Ord> Ord for Rev<T> {
    fn cmp(&self, other: &Rev<T>) -> Ordering {
        other.0.cmp(&self.0)
    }
}
fn sieve(n:usize) -> (Vec<bool>, Vec<usize>){
    let mut p:usize = 0;
    let mut is_prime = vec![false; n+1];
    let mut prime = Vec::new();
    for i in 0..n+1{
        is_prime[i] = true;
    }
    is_prime[0] = false;
    is_prime[1] = false;
    for i in 2..n+1{
        if is_prime[i]{
            prime.push(i as usize);
            let mut j = 2*i;
            while(j<=n){
                is_prime[j] = false;
                j+=i;
            }
        }
    }
    (is_prime, prime)

}
fn nHr(n:usize, r:usize, fac:&Vec<ModInt>, ifac:&Vec<ModInt>) -> ModInt{
    comb(n + r - 1, r, fac, ifac)
}
fn gcd(a:usize, b:usize)->usize{
    if b==0{return a;}
    return gcd(b, a%b);
}
fn lcm(a:usize, b:usize)->usize{
    return (b/gcd(a, b))*a;
}
struct SegTree_MOD<BiOp> {
    n: usize,
    dat: Vec<i64>,
    op: BiOp,
    e: i64,
    mod_:i64,
}
impl<BiOp> SegTree_MOD<BiOp>
    where BiOp: Fn(i64, i64) -> i64
          {
    pub fn new(n_: usize, op: BiOp, e: i64, mod_:i64) -> Self {
        let mut n = 1;
        while n < n_ { n *= 2; } // n is a power of 2
        SegTree_MOD {n: n, dat: vec![e; 2 * n - 1], op: op, e: e, mod_:mod_}
    }
    /* ary[k] <- v */
    pub fn update(&mut self, idx: usize, v: i64) {
        let mut k = idx + self.n - 1;
        self.dat[k] = v;
        while k > 0 {
            k = (k - 1) / 2;
            self.dat[k] = (self.op)(self.dat[2 * k + 1], self.dat[2 * k + 2]);
            self.dat[k] %= self.mod_;
        }
    }
    /* [a, b) (note: half-inclusive)
     * http://proc-cpuinfo.fixstars.com/2017/07/optimize-segment-tree/ */
    pub fn query(&self, mut a: usize, mut b: usize) -> i64 {
        let mut left = self.e;
        let mut right = self.e;
        a += self.n - 1;
        b += self.n - 1;
        while a < b {
            if (a & 1) == 0 {
                left = (self.op)(left, self.dat[a]);
                left %= self.mod_;
            }
            if (b & 1) == 0 {
                right = (self.op)(self.dat[b - 1], right);
                right %= self.mod_;
            }
            a = a / 2;
            b = (b - 1) / 2;
        }
        let mut res = (self.op)(left, right);
        res %= self.mod_;
        res

    }
}
fn modpow2(x:usize, n:usize) -> usize{
        let mut ans = 1;
        let mut n = n;
        let mut x = x;
        while(n != 0){
            if (n&1 == 1){ans = ans*x%13;}
            x = x*x%13;
            n = n>>1;
        }
        ans
}
#[derive(Clone)]
struct PPUnionFind{
    par:Vec<usize>,
    rank:Vec<usize>,
    time:Vec<usize>,
    now:usize,
    history:Vec<(usize, usize)>,
}
impl PPUnionFind{
    fn init(n:usize) -> PPUnionFind{
        let mut par = vec![0;n];
        for i in 0..n{
            par[i] = i;
        }
        PPUnionFind{
            par:par,
            rank:vec![0;n],
            time:vec![INF as usize;n],
            now:0,
            history:vec![],
        }
    }
    fn find(&mut self, t:usize, x:usize) ->usize{
        if self.time[x] > t{return x;}
        else { let tt = self.par[x]; return self.find(t, tt);}
    }
    fn unite(&mut self, x:usize, y:usize) -> usize{
        self.now+=1;
        let mut x = x;
        let mut y = y;
        let nc = self.now;
        x = self.find(nc, x);
        y = self.find(nc, y);
        if x == y{return self.now;}
        if self.par[x] < self.par[y] {mem::swap(&mut x, &mut y);}
        self.par[x] += self.par[y];
        self.history.push((self.now, self.par[x]));
        self.par[y] = x;
        self.time[y] = self.now;
        return self.now;
    }
}

fn prim(cost:&Vec<Vec<(usize, i64)>>, vs:usize)->i64{
    let mut used = vec![false; vs];
    let mut bh = BinaryHeap::new();
    for j in 0..cost[0].len(){
            bh.push((cost[0][j].1, cost[0][j].0));
    }
    used[0] = true;
    let mut res = 0;
    while(bh.len()!=0){
        let mut m = bh.pop().unwrap();
        if used[m.1]{continue;}
        used[m.1] = true;
        for e in 0..cost[m.1].len(){
            if used[cost[m.1][e].0] == false{
                bh.push((cost[m.1][e].1, cost[m.1][e].0));
            }
        }
        res += m.0;
    }
    return res;
}
fn kruscal(cost:&mut Vec<(i64, usize, usize)>, vs:usize)->i64{
    cost.sort();
    let mut uf = UnionFind::init(vs);
    let mut res = 0;

    for i in 0..cost.len(){
        let e = cost[i].clone();
        if uf.find(e.1) != uf.find(e.2){
            uf.unite(e.1, e.2);
            res += e.0;
        }
    }
    return res;
}
fn kruscal3(cost:&mut Vec<(f64, usize, usize, usize)>, vs:usize)->(UnionFind, Vec<usize>) {
    cost.sort_by(|a, b| (&a.0).partial_cmp(&b.0).unwrap());
    let mut uf = UnionFind::init(vs);
    let mut res = 0.0;
    let mut rv = Vec::new();
    let mut c = 0.0;
    let mut t = 0.0;
    for i in 0..cost.len(){
        let e = cost[i].clone();
        if uf.find(e.1) != uf.find(e.2){
            uf.unite(e.1, e.2);
            rv.push(e.3);
        }
    }
    return (uf,rv);
}
fn kruscal2(cost:&mut Vec<(f64, usize, usize)>, vs:usize)->f64{
    cost.sort_by(|a, b| (&a.0).partial_cmp(&b.0).unwrap());
    let mut uf = UnionFind::init(vs);
    let mut res = 0.0;
    for i in 0..cost.len(){
        let e = cost[i].clone();
        if uf.find(e.1) != uf.find(e.2){
            uf.unite(e.1, e.2);
            res+= e.0;
        }
    }
    return res;
}

struct segtree<I, Op>{
    n: usize,
    dat: Vec<I>,
    op:Op,
    e:I,
}
impl<I, Op> segtree<I, Op>

    where Op: Fn(I, I) -> I, I:Copy{

        pub fn new(n_:usize, op: Op, e:I)->Self{
            let mut n = 1;
            while(n<n_){n*=2;}
            segtree{n: n, dat:vec![e; 2*n-1], op:op, e:e}
        }
        pub fn update(&mut self, k:usize, a:I){
            let mut k = k;
            k += self.n-1;
            self.dat[k] = a;
            while(k>0){
                k = (k-1)/2;
                self.dat[k] = (self.op)(self.dat[k*2 + 1], self.dat[k*2+2]);
            }
        }
        pub fn query(&self, a:usize, b:usize, k:usize, l:usize, r:usize) -> I{
            if r<=a || b<=l{return self.e;}
            if a<=l && r<=b{return self.dat[k];}
            else{
                let mut vl = self.query(a, b, k*2+1, l, (l+r)/2);
                let mut vr = self.query(a, b, k*2+2, (l+r)/2, r);
                return (self.op)(vl, vr);
            }
        }
    }
struct BIT<I, Op>{
    n:usize,
    bit:Vec<I>,
    op:Op,
    e:I,
    ini:I,
}
impl <I, Op>  BIT<I, Op>
    /* 1-index*/
    where Op: Fn(I, I) -> I, I:Copy{
        pub fn new(n_:usize, op:Op, e:I, ini:I)->Self{
            BIT{n:n_, bit:vec![e;n_+1], op:op, e:e, ini:ini}
        }
        pub fn sum(&self, i:usize)->I{
            let mut s = self.ini;
            let mut i = i as i64;
            while(i>0){
                s = (self.op)(s, self.bit[i as usize]);
                i -= i & -i;
            }
            return s;
        }
        pub fn add(&mut self, i:usize, x:I){
            let mut i = i as i64;
            while(i<=self.n as i64){
                self.bit[i as usize] = (self.op)(self.bit[i as usize], x);
                i += i & -i;
            }
        }
    }
struct Dsegtree{
    n: usize,
    datA: Vec<i64>,
    datB:Vec<i64>,
    e:i64,
}
impl Dsegtree{
        pub fn new(n_:usize, e:i64)->Self{

            Dsegtree{n:n_, datA:vec![e; 1<<22 - 1], datB:vec![e;1<<22 - 1], e:e}
        }
        pub fn update(&mut self,a:usize, b:usize, x:i64,  k:usize, l:usize, r:usize){
            //println!("{} {} {} {} {} {}", a, b, x, k , l, r);
            if a<=l && r<=b{
                self.datA[k] += x;
            }
            else if (l<b && a<r){
                self.datB[k] += (cmp::min(b, r) as i64 - cmp::max(a, l) as i64) * x;
                self.update(a, b, x, k*2+1, l, (l+r)/2);
                self.update(a, b, x, k*2+2, (l+r)/2, r);
            }
        }
        pub fn query(&self, a:usize, b:usize, k:usize, l:usize, r:usize) -> i64{
            if (b<=l || r<=a){
                return 0;
            }
            else if (a<=l && r<=b){
                return self.datA[k] * ((r as i64-l as i64)) + self.datB[k];
            }
            else{
                let mut res = (cmp::min(b, r) as i64 - cmp::max(a, l) as i64)* self.datA[k];
                res += self.query(a, b, k*2+1, l, (l+r)/2);
                res += self.query(a, b, k*2+2, (l+r)/2, r);
                return res;
            }
        }
    }
/*
unwrap_or_else
*/
fn prime_factor(n:usize)->HashMap<usize, usize>{
    let mut res = HashMap::new();
    let mut n = n;
    for i in 2..n{
        if i*i>n{break;}
        while(n%i==0){
            *res.entry(i).or_insert(0)+=1;
            n/=i;
        }
    }
    if n != 1{
        res.insert(n, 1);
    }
    res
}
struct rollinghash{
    base:Vec<i64>,
    Mod:Vec<i64>,
    hash:Vec<Vec<i64>>,
    power:Vec<Vec<i64>>,
}
impl rollinghash{
    pub fn new(s:&Vec<usize>)->Self{
        let mut n = s.len();
        let mut base = vec![1007, 2009];
        let mut hash = vec![vec![0;n+1];2];
        let mut power = vec![vec![1;n+1];2];
        let mut Mod = vec![1000000007, 1000000009];
        for iter in 0..2{
            let mut ht = vec![0;n+1];
            let mut pt = vec![1;n+1];
            for i in 0..n{
                hash[iter][i+1] = (hash[iter][i] * base[iter] + s[i] as i64) % Mod[iter];
                power[iter][i+1] = power[iter][i] * base[iter] % Mod[iter];
            }
        }
        return rollinghash{base:base, Mod:Mod, hash:hash, power:power}

    }
    pub fn get(&self, l:usize, r:usize)->(i64, i64){
        let mut res = self.hash[0][r] - self.hash[0][l] * self.power[0][r-l] % self.Mod[0];
        if res<0{
            res += self.Mod[0];
        }
        let mut res2 = self.hash[1][r] - self.hash[1][l] * self.power[1][r-l] % self.Mod[1];
        if res2<0{
            res2 += self.Mod[1];
        }
        return (res, res2);
    }

}
struct LCA{
    G:Vec<Vec<i64>>,
    parent:Vec<Vec<i64>>,
    depth:Vec<i64>,
    root:i64,
}
impl LCA{
    pub fn new(G:Vec<Vec<i64>>, N:i64,R:i64)->Self{
        let D = (f64::log2(N as f64)) as i64 + 2;
        LCA{G:G, parent:vec![vec![0;N as usize];1+D as usize], depth:vec![0;N as usize], root:R}
    }
    pub fn getP(&mut self, v:i64, p:i64, d:i64){
        self.parent[0][v as usize] = p;
        self.depth[v as usize] = d;
        for i in 0..self.G[v as usize].len(){
            if self.G[v as usize][i as usize] != p{
                let n = self.G[v as usize][i as usize];
                self.getP(n, v, d+1);
            }
        }
    }
    pub fn init(&mut self){
        let root = self.root;
        self.getP(root, -1, 0);
        let V = self.depth.len();
        let logN = f64::log2(V as f64) as i64 + 2;
        for k in 0..logN{
            for v in 0..V{
                if self.parent[k as usize][v as usize] <0{
                    self.parent[k as usize+1][v as usize] = -1;
                }
                else{
                    self.parent[k as usize+1][v as usize] = self.parent[k as usize][ (self.parent[k as usize][v as usize]) as usize];
                }
            }
        }
    }
    fn ft(&self, f:i64, d:i64)->i64{
        let mut now = f;
        let mut now2 = 0;
        let V = self.depth.len();

        let logN = f64::log2(V as f64) as i64 + 2;
        let mut v = f;
        for k in 0..logN{
            if (d >> k) & 1 == 1{
                v = self.parent[k as usize][v as usize];
            }
        }

        return v;
    }

    fn lca(&mut self,u:i64, v:i64)->i64{
        let mut u = u;
        let mut v = v;
        if self.depth[u as usize] > self.depth[v as usize]{
            mem::swap(&mut u, &mut v);
        }
        let mut V = self.depth.len();
        let logN = f64::log2(V as f64) as i64 + 2;
        for k in 0..logN{
            if ((self.depth[v as usize] - self.depth[u as usize]) >> k)&1 == 1{
                v = self.parent[k as usize][v as usize];
            }
        }
        if u == v{return u;}
        for k in (0..logN).rev(){
            if self.parent[k as usize][u as usize] != self.parent[k as usize][v as usize]{
                u = self.parent[k as usize][u as usize];
                v = self.parent[k as usize][v as usize];
            }
        }
        return self.parent[0][u as usize];
    }

    fn dist(&mut self,u:i64, v:i64)->i64{
        let lc = self.lca(u, v);
        return self.depth[u as usize] + self.depth[v as usize] - 2* self.depth[lc as usize];
    }

}
fn fast_prime_factor_table(ma:usize)->Vec<usize>{
    let mut p = sieve(1001);
    let mut minf = vec![0;ma];
    for j in 0..p.1.len(){
        let P = p.1[j];
        let mut now = P;
        for i in 2..ma{
            if minf[now] ==0{
                minf[now] = P;
            }
            now+=P;
            if now>=ma{
                break;
            }
        }
    }
    return minf;
}
fn area_rectanble(x1:f64, x2:f64, x3:f64, y1:f64, y2:f64, y3:f64)->f64{
    let tmp = x1*y2 + x2*y3 + x3*y1 - y1*x2 - y2*x3 - y3*x1;
    tmp.abs()/2.0
}
#[derive(PartialEq, Clone)]
struct FW(f64);

impl Eq for FW {}

impl PartialOrd for FW {
    fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
        self.0.partial_cmp(&other.0)
    }
}

impl Ord for FW {
    fn cmp(&self, other: &FW) -> Ordering {
        other.partial_cmp(self).unwrap()

    }
}
/* parsing
    fn expr(s:&Vec<char>, i:&mut usize) -> Vec<usize>{
        let mut val = term(s, i);
        while(*i<s.len() && (s[*i] == '+' || s[*i] == '-')){
            let mut op = encode(s[*i]);
            *i+=1;
            let mut val2 = term(s, i);
            val = cal(val, val2, op);
        }
        return val;
    }
    fn term(s:&Vec<char>, i:&mut usize) -> Vec<usize>{
        let mut val = factor(s, i);
        while(*i<s.len() && s[*i] == '*'){
            let mut op = encode(s[*i]);
            *i+=1;
            let mut val2 = factor(s, i);
            val = cal(val, val2, op);
        }
        return val;
    }
    fn factor(s:&Vec<char>, i:&mut usize)->Vec<usize>{
        if s[*i] == 'R' || s[*i] == 'S' || s[*i] == 'P' || s[*i] == '?'{
            let mut res = encode(s[*i]);
            *i+=1;
            return res;
        }
        *i+=1;
        let mut ret = expr(s, i);
        *i+=1;
        return ret;
    }
*/
fn matmulf64(A:&Vec<Vec<f64>>, B:&Vec<Vec<f64>>) -> Vec<Vec<f64>>{
    let mut C = vec![vec![0.0;B[0].len()];A.len()];
    for i in 0..A.len(){
        for k in 0..B.len(){
            for j in 0..B[0].len(){
                C[i][j] += A[i][k]*B[k][j];
            }
        }
    }
    return C;
}
//sort_by_key(|a| vec![a[0], -a[1]]);

#[macro_use]
extern crate lazy_static;
use std::sync::Mutex;
fn solve(){
    //let sssss = std::io::stdin();
    //let mut sc = Scanner { stdin: sssss.lock() };
    input!{
        A:usize,
        B:usize,
        N:usize,
    }
    println!("{}", (A*cmp::min(N, B-1))/B);

}

fn main(){
    solve();
}
const PI:f64 = std::f64::consts::PI;
pub static MOD:i64 = 1000000007;
pub static MODu:usize = 1000000007;
pub static eps:f64 = 1e-6;
const INF: i64 = 1 << 60;


/* #region template */
#![allow(unused_imports)]
use std::cmp::{max, min};
use std::io::{stdin, stdout, Bytes, Read, Stdin, StdinLock, Stdout, StdoutLock, Write};
use std::iter::{repeat, repeat_with};
use std::mem::swap;
use std::str::FromStr;
#[allow(dead_code)]
struct Io<'a> {
    reader: Bytes<StdinLock<'a>>,
    writer: StdoutLock<'a>,
    in_buf: [u8; BUF_SIZE],
}
#[allow(dead_code)]
impl<'a> Io<'a> {
    fn new(stdin: &'a Stdin, stdout: &'a Stdout) -> Io<'a> {
        Io {
            reader: stdin.lock().bytes(),
            writer: stdout.lock(),
            in_buf: [0; BUF_SIZE],
        }
    }
    fn r<T: FromStr>(&mut self) -> T {
        let mut count = 0;
        loop {
            match self.reader.next() {
                Some(Ok(b' ')) | Some(Ok(b'\n')) => break,
                Some(Ok(c)) => self.in_buf[count] = c,
                _ => panic!(),
            }
            count += 1;
        }

        let s = unsafe { std::str::from_utf8_unchecked(&self.in_buf[0..count]) };
        s.parse().unwrap_or_else(|_| panic!())
    }
    fn ru(&mut self) -> usize {
        self.r()
    }
    fn iter<'b, T>(&'b mut self) -> IoIter<'a, 'b, T> {
        IoIter::new(self)
    }
    fn c<T: FromStr>(&mut self, n: usize) -> Vec<T> {
        self.iter().take(n).collect()
    }
    fn cu(&mut self, n: usize) -> Vec<usize> {
        self.c(n)
    }
    fn w<T: std::fmt::Display>(&mut self, v: T) {
        writeln!(self.writer, "{}", v).unwrap();
    }
    fn wn<T: std::fmt::Display>(&mut self, v: T) {
        write!(self.writer, "{}", v).unwrap();
    }
}
#[allow(dead_code)]
struct IoIter<'a: 'b, 'b, T> {
    io: &'b mut Io<'a>,
    m: std::marker::PhantomData<T>,
}
#[allow(dead_code)]
impl<'a: 'b, 'b, T> IoIter<'a, 'b, T> {
    fn new(io: &'b mut Io<'a>) -> IoIter<'a, 'b, T> {
        IoIter {
            io,
            m: std::marker::PhantomData,
        }
    }
}
impl<'a, 'b, T: FromStr> Iterator for IoIter<'a, 'b, T> {
    type Item = T;
    fn next(&mut self) -> Option<Self::Item> {
        Some(self.io.r())
    }
}
fn main() {
    let stdin = stdin();
    let stdout = stdout();
    let mut io = Io::new(&stdin, &stdout);
    unsafe {
        solve(&mut io);
    }
}
/* #endregion */

const BUF_SIZE: usize = 1024;

unsafe fn solve(io: &mut Io) {
    let a = io.ru();
    let b = io.ru();
    let n = io.ru();

    let x = min(b - 1, n);

    io.w((a * x) / b - a * (x / b));
}


use proconio::*;

fn run() {
    input! {
        a: u64,
        b: u64,
        n: u64,
    }
    let x = std::cmp::min(b - 1, n);
    let ans = a * x / b - a * (x / b);
    println!("{}", ans);
}

fn main() {
    run();
}


#[allow(unused_imports)]
use proconio::{fastout, input, marker::*};

#[fastout]
fn main() {
    input! {
        a: usize,
        b: usize,
        n: usize,
    }
    let mut ans = 0;
    for i in 1..n+1 {
        ans = std::cmp::max(ans, f64::floor((a * i / b) as f64) as usize - a * f64::floor((i / b) as f64) as usize);
    }

    println!("{}", ans);
}


use proconio::input;

fn main() {
    input! {
        a: f64,
        b: f64,
        n: f64,
    }

    let ans = if n > b {
            floor_funtion(a, b, b-1.0)
        } else {
            floor_funtion(a, b, n)
        };

        println!("{}", ans as u64);

}

fn floor_funtion(a: f64, b: f64, x: f64) -> f64 {
    return (a*x/b).floor() - a * (x/b).floor();
}


#![allow(unused_imports)]
#![allow(unused_variables)]

use itertools::Itertools;
use proconio::{fastout, input};

#[fastout]
fn main() {
    input! {
        a: usize,
        b: usize,
        n: usize,
    }
    // annotate for rust-analyzer
    let a: usize = a;
    let b: usize = b;
    let n: usize = n;

    let x = if n > b { b - 1 } else { n };
    let ans = a * x / b - a * (x / b);

    println!("{}", ans);
}


let abn = readLine()!.split(separator: " ").map { Int($0)! }
let (a, b, n) = (abn[0], abn[1], abn[2])

print(a * min(n, b - 1) / b)


import Foundation
let main: () = {
    let (A, B, N) = *listOfInt()
    if N < B {
        return print((A * N) / B)
    }
    print((A * (B - 1)) / B)
}()

//----------------------------------

let dx = [1, 0, -1, 0] //[1, 0, -1, 0, -1,  1, -1, 1]
let dy = [0, 1, 0, -1] //[0, 1, 0, -1, -1, -1,  1, 1]

@inlinable func gcd(_ a: Int, _ b: Int) -> Int { (b > 0) ? gcd(b, a % b) : a }
@inlinable func lcm(_ a: Int, _ b: Int) -> Int { a / gcd(a, b) * b }

//----------------------------------

infix operator  =~ : ComparisonPrecedence
infix operator !=~ : ComparisonPrecedence
func =~ <T: FixedWidthInteger>(left: T, right: Range<T>) -> Bool { right ~= left }
func !=~ <T: FixedWidthInteger>(left: T, right: Range<T>) -> Bool { !(right ~= left) }
func =~ <T: FixedWidthInteger>(left: T, right: ClosedRange<T>) -> Bool { right ~= left }
func !=~ <T: FixedWidthInteger>(left: T, right: ClosedRange<T>) -> Bool { !(right ~= left) }

func =~ <T: Collection > (left: T.Element, right: T) -> Bool where T.Element : Equatable { right.contains(left) }
func !=~ <T: Collection > (left: T.Element, right: T) -> Bool where T.Element : Equatable { !right.contains(left) }

infix operator /^ : MultiplicationPrecedence
infix operator /^= : AssignmentPrecedence
func /^ <T: FixedWidthInteger>(left: T, right: T) -> T { (left + (right - 1)) / right }
func /^= <T: FixedWidthInteger>(left: inout T, right: T) { left = (left + (right - 1)) / right }

@inlinable func chmax<T: Comparable>(_ m: inout T, _ q: T) { if (m < q) { m = q } }
@inlinable func chmin<T: Comparable>(_ m: inout T, _ q: T) { if (m > q) { m = q } }
@inlinable func chRmax<T: Comparable>(_ m: inout T, _ q: T) -> Bool { if (m < q) { m = q; return true } else { return false } }
@inlinable func chRmin<T: Comparable>(_ m: inout T, _ q: T) -> Bool { if (m > q) { m = q; return true } else { return false } }

prefix operator *
prefix func * <T> (a: [T]) -> (T, T) { (a[0], a[1]) }
prefix func * <T> (a: [T]) -> (T, T, T) { (a[0], a[1], a[2]) }
prefix func * <T> (a: [T]) -> (T, T, T, T) { (a[0], a[1], a[2], a[3]) }
prefix func * <T> (a: [T]) -> (T, T, T, T, T) { (a[0], a[1], a[2], a[3], a[4]) }
prefix func * <T> (a: [T]) -> (T, T, T, T, T, T) { (a[0], a[1], a[2], a[3], a[4], a[5]) }

func printErr(_ str: String, terminator: String = "\n") {
    let s = str + terminator
    FileHandle.standardError.write(s.data(using: .utf8)!)
    FileHandle.standardError.synchronizeFile()
}

@inlinable func next() -> String { readLine()! }
@inlinable func nextInt() -> Int { Int(next())! }
@inlinable func nextDouble() -> Double { Double(next())! }
@inlinable func listOfString() -> [String] { next().split(separator: " ").map(String.init) }
@inlinable func listOfInt() -> [Int] { listOfString().map { Int($0)! } }
@inlinable func listOfInt(_ offset: Int = 0) -> [Int] { listOfString().map { Int($0)! + offset } }
@inlinable func listOfInt(_ offsets: Int ...) -> [Int] { listOfString().enumerated().map { Int($0.element)! + offsets[$0.offset % offsets.count] } }
@inlinable func listOfDouble(_ offset: Double = 0.0) -> [Double] { listOfString().map { Double($0)! + offset } }
@inlinable func listOfDouble(_ offsets: Double ...) -> [Double] { listOfString().enumerated().map { Double($0.element)! + offsets[$0.offset % offsets.count] } }

extension Int {
    init(s: String) { self.init(s)! }
    var isEven: Bool { self.isMultiple(of: 2) }
    var isOdd: Bool { !self.isEven }
    var isTrue: Bool { self != 0 }
    var isFalse: Bool { !self.isTrue }
    var toString: String { String(self) }
    var toChar: Character { Character(UnicodeScalar(UInt8(self))) }
}
func + (left: Int, right: Bool) -> Int { left + (right ? 1 : 0) }
extension Character {
    var asciiCode: Int { Int(self.asciiValue!) }
    var string: String { String(self) }
}
extension String {
    @inlinable subscript (position: Int) -> Character { self[self.index(self.startIndex, offsetBy: position)] }
    @inlinable func repeate(_ times: Int) -> String { String(repeating: self, count: times) }
    //  @inlinable subscript (n: Int) -> String { String(self[self.index(self.startIndex, offsetBy: n)]) }
    //  @inlinable subscript (n: Int) -> Int { Int(self[self.index(self.startIndex, offsetBy: n)].asciiValue!) }
    var toInt: Int { Int(self)! }
}
extension String { // VB like
    @inlinable func _index(_ position: Int) -> String.Index! {
        if !(0 ..< self.count ~= position) { return nil }
        return self.index(self.startIndex, offsetBy: position)
    }
    @inlinable func mid(from index: Int, length: Int) -> String! {
        if let startPosition = self._index(index) {
            if let endPosition = self._index(index + length - 1) {
                return String(self[startPosition...endPosition])
            } else {
                let endPosition = self.index(before: self.endIndex)
                return String(self[startPosition...endPosition])
            }
        }
        return ""
    }
    @inlinable func left(_ length: Int) -> String { String(self.prefix(length)) }
    @inlinable func right(_ length: Int) -> String { String(self.suffix(length)) }
}

extension Dictionary {
    @inlinable mutating func getOrSet(_ key: Key, _ defaultValue: () -> Value) -> Value {
        if let stored = self[key] { return stored }
        else {
            let newValue = defaultValue()
            self[key] = newValue
            return newValue
        }
    }
    @inlinable mutating func getOrElse(_ key: Key, _ defaultValue: () -> Value) -> Value {
        if let stored = self[key] { return stored } else { return defaultValue() }
    }
    @inlinable func containsKey(_ key: Key) -> Bool { self.keys.contains(key) }
}

extension Set {
    static func += (left: inout Set<Element>, right: Element) { left.insert(right) }
    static func -= (left: inout Set<Element>, right: Element) { left.remove(right) }
}

extension Array {
    static func += (left: inout Array<Element>, right: Element) { left.append(right) }
    init(_ size: Int, _ initValue: ((Int) -> Element)) {
        self = [Element]()
        for index in 0 ..< size {
            let value = initValue(index)
            self.append(value)
        }
    }
    init(_ size: Int, _ initValue: (() -> Element)) {
        self = [Element]()
        for _ in 0 ..< size {
            let value = initValue()
            self.append(value)
        }
    }
}
typealias IntArray = Array<Int>
typealias DoubleArray = Array<Double>
typealias BoolArray = Array<Bool>
typealias StringArray = Array<String>

extension Array where Element == Int {
    init(_ size: Int) {
        self = [Element](repeating: 0, count: size)
    }
}
extension Array where Element == Double {
    init(_ size: Int) {
        self = [Element](repeating: 0.0, count: size)
    }
}
extension Array where Element == Bool {
    init(_ size: Int) {
        self = [Element](repeating: false, count: size)
    }
}
extension Array where Element == String {
    init(_ size: Int) {
        self = [Element](repeating: "", count: size)
    }
}

extension Array {
    @inlinable func count(_ predicate: ((Element) -> Bool)) -> Int {
        var cnt = 0; for e in self { if (predicate(e)) { cnt += 1 } }
        return cnt
    }
    @inlinable func groupBy<K>(_ keySelector: (Element) -> K) -> [K : [Element]] {
        var destination = [K : [Element]]()
        for element in self {
            let key = keySelector(element)
            var list = destination.getOrSet(key) { [Element]() }
            list.append(element)
            destination[key] = list
        }
        return destination
    }
    @inlinable func groupByIndexed<K>(_ keySelector: (Element) -> K) -> [K : [Int]] {
        var destination = [K : [Int]]()
        for element in self.enumerated() {
            let key = keySelector(element.element)
            var list = destination.getOrSet(key) { [Int]() }
            list.append(element.offset)
            destination[key] = list
        }
        return destination
    }
}

extension Array {
    func binarySearch(_ element: Element, by compare: (Element, Element) -> Int, fromIndex: Int = 0, toIndex: Int = -1) -> Int {
        var low = fromIndex
        var high = (toIndex == -1) ? self.count - 1 : toIndex - 1
        while (low <= high) {
            let mid = (low + high) >> 1 // safe from overflows
            let midVal = self[mid]
            let cmp = compare(midVal, element)
            if (cmp < 0) { low = mid + 1 }          //-1
            else if (0 < cmp) { high = mid - 1 }    // 1
            else { return mid } // key found        // 0
        }
        return -(low + 1)  // key not found
    }
}
extension Array where Element : Comparable {
    func binarySearch(_ element: Element, fromIndex: Int = 0, toIndex: Int = -1) -> Int {
        var low = fromIndex
        var high = (toIndex == -1) ? self.count - 1 : toIndex - 1
        while (low <= high) {
            let mid = (low + high) >> 1 // safe from overflows
            let midVal = self[mid]
            if (midVal < element) { low = mid + 1 }
            else if (midVal > element) { high = mid - 1 }
            else { return mid } // key found
        }
        return -(low + 1)  // key not found
    }
}

extension Array where Element == Int {
    @inlinable func distinct() -> [Element] {
        var set = Set<Element>(), ary = [Element]()
        for n in self.indices { if !set.contains(self[n]) { ary.append(self[n]); set.insert(self[n]) } }
        return ary
    }
    @inlinable func any(_ predicate: (Element) -> Bool) -> Bool {
        var any = false; for element in self { if predicate(element) { any = true } }
        return any
    }
    @inlinable func all(_ predicate: (Element) -> Bool) -> Bool {
        self.allSatisfy(predicate)
    }
    @inlinable func sum() -> Element { self.reduce(0, +) }
    @inlinable func sum(by predicate: (Element) -> Element) -> Element {
        var sum = 0; for e in self { sum += predicate(e) }
        return sum
    }
    @inlinable func joinToString(_ sepatator: String = " ") -> String { self.map { String($0) }.joined(separator: sepatator) }
}

extension Array where Element == Double {
    @inlinable func sum() -> Element { self.reduce(0.0, +) }
    @inlinable func sum(by predicate: (Element) -> Element) -> Element {
        var sum = 0.0; for e in self { sum += predicate(e) }
        return sum
    }
    @inlinable func joinToString(_ sepatator: String = " ") -> String { self.map { String($0) }.joined(separator: sepatator) }
}
extension Array where Element == String {
    @inlinable func toIntDouble() -> (Int, Double) { (Int(self[0])!, Double(self[1])!) }
    @inlinable func toIntString() -> (Int, String) { (Int(self[0])!, self[1]) }
    @inlinable func toIntIntString() -> (Int, Int, String) { (Int(self[0])!, Int(self[1])!, self[2]) }
}

@inlinable func repeate(_ times1: Int, _ action: () -> Void) {
    for _ in 0 ..< times1 { action() }
}
@inlinable func repeate(_ times1: Int, _ action: (Int) -> Void) {
    for index1 in 0 ..< times1 {
        action(index1)
    }
}
@inlinable func repeate(_ times1: Int, _ times2: Int, _ action: (Int, Int) -> Void) {
    for index1 in 0 ..< times1 {
        for index2 in 0 ..< times2 {
            action(index1, index2)
        }
    }
}
@inlinable func repeate(_ times1: Int, _ times2: Int, _ times3: Int, _ action: (Int, Int, Int) -> Void) {
    for index1 in 0 ..< times1 {
        for index2 in 0 ..< times2 {
            for index3 in 0 ..< times3 {
                action(index1, index2, index3)
            }
        }
    }
}
@inlinable func repeate(_ times1: Int, _ times2: Int, _ times3: Int, _ times4: Int, _ action: (Int, Int, Int, Int) -> Void) {
    for index1 in 0 ..< times1 {
        for index2 in 0 ..< times2 {
            for index3 in 0 ..< times3 {
                for index4 in 0 ..< times4 {
                    action(index1, index2, index3, index4)
                }
            }
        }
    }
}

func measureTimeSeconds(block: (() -> Void)) -> Double {
    let startTime = Date()
    block()
    let duration = -startTime.timeIntervalSinceNow
    return duration
}


import Foundation

let MOD = 10 ** 9 + 7
let alphabets = "abcdefghijklmnopqrstuvwxyz"
let ALPHABETS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
prefix operator *
infix operator **: PowerPrecedence
precedencegroup PowerPrecedence {
    higherThan: MultiplicationPrecedence
    lowerThan: BitwiseShiftPrecedence
    associativity: right
}
prefix func * <T> (a: [T]) -> (T, T)             { return (a[0], a[1]) }
prefix func * <T> (a: [T]) -> (T, T, T)          { return (a[0], a[1], a[2]) }
prefix func * <T> (a: [T]) -> (T, T, T, T)       { return (a[0], a[1], a[2], a[3]) }
prefix func * <T> (a: [T]) -> (T, T, T, T, T)    { return (a[0], a[1], a[2], a[3], a[4]) }
prefix func * <T> (a: [T]) -> (T, T, T, T, T, T) { return (a[0], a[1], a[2], a[3], a[4], a[5]) }
func **(lhs: Int, rhs: Int) -> Int {
    return Int(pow(Double(lhs), Double(rhs)))
}
func **(lhs: Int, rhs: Double) -> Double {
    return pow(Double(lhs), rhs)
}
func * <Element> (lhs: [Element], rhs: Int) -> [Element] {
    return (0..<rhs).flatMap{_ in lhs}
}
func *(lhs: String, rhs: Int) -> String {
    return (0..<rhs).reduce(""){s,_ in s+lhs}
}
struct Stack<Element>: Collection {
    var items = [Element]()
    var startIndex: Int {
        return items.startIndex
    }
    var endIndex: Int {
        return items.endIndex
    }
    subscript(i: Int) -> Element {
        return items[i]
    }
    func index(after index: Int) -> Int {
        return items.index(after: index)
    }
    mutating func push(_ item: Element) {
        items.append(item)
    }
    mutating func pop() -> Element {
        return items.removeLast()
    }
}
struct Queue<Element>: Collection {
    var items = [Element]()
    var startIndex: Int {
        return items.startIndex
    }
    var endIndex: Int {
        return items.endIndex
    }
    subscript(i: Int) -> Element {
        return items[i]
    }
    func index(after index: Int) -> Int {
        return items.index(after: index)
    }
    mutating func push(_ item: Element) {
        items.append(item)
    }
    mutating func pop() -> Element {
        return items.removeFirst()
    }
}
struct Heap<Element: Comparable>: Collection {
    var items = [Element]()
    var startIndex: Int {
        return items.startIndex
    }
    var endIndex: Int {
        return items.endIndex
    }
    subscript(i: Int) -> Element {
        return items[i]
    }
    func index(after index: Int) -> Int {
        return items.index(after: index)
    }
    mutating func push(_ item: Element) {
        var i = items.count
        while i > 0 {
            let p = (i - 1) / 2
            if items[p] <= item {
                break
            }
            if i == items.count {
                items.append(items[p])
            } else {
                items[i] = items[p]
            }
            i = p
        }
        if i == items.count {
            items.append(item)
        } else {
            items[i] = item
        }
    }
    mutating func pop() -> Element {
        let ret = items[0]
        let x = items[items.endIndex]
        var i: Int = 0
        while i * 2 + 1 < items.endIndex {
            var a = i * 2 + 1
            let b = i * 2 + 2
            if b < items.endIndex && items[b] < items[a] {
                a = b
            }
            if items[a] >= x {
                break
            }
            items[i] = items[a]
            i = a
        }
        items[i] = x
        items.removeLast()
        return ret
    }
}
extension Array {
    func binarySearch(_ key: Element, _ condition: (Element, Element) -> Bool) -> Int {
        var ng = -1
        var ok = self.count
        while abs(ok - ng) > 1 {
            let mid = (ok + ng) / 2
            if condition(key, self[mid]) {
                ok = mid
            } else {
                ng = mid
            }
        }
        return ok
    }
}
extension Array where Element: Equatable {
    func count(of value: Element) -> Int {
        return self.reduce(0){$0+($1==value ? 1 : 0)}
    }
}
extension Array where Element: Hashable {
    func tally() -> Dictionary<Element, Int> {
        var dic = [Element: Int]()
        self.forEach{dic[$0, default: 0] += 1}
        return dic
    }
}
extension String {
    func count(of value: Character) -> Int {
        return self.reduce(0){$0+($1==value ? 1 : 0)}
    }
    subscript(i: Int) -> Character {
        return self.map{$0}[i]
    }
    subscript(range: Range<Int>) -> String {
        return String(self.map{$0}[range])
    }
}
func readInt() -> Int? {
    return Int(readLine()!)
}
func readStringsSplit(by separator: Character = " ") -> [String] {
    return readLine()!.split(separator: separator).map{String($0)}
}
func readIntsSplit(by separator: Character = " ") -> [Int] {
    return readLine()!.split(separator: separator).map{Int($0)!}
}
func gcd(_ x: Int, _ y: Int) -> Int {
    return y>0 ? gcd(y, x%y) : x
}
func lcm(_ x: Int, _ y: Int) -> Int {
    return x * y / gcd(x, y)
}
func manhattanDistance(_ x1: Int, _ y1: Int, _ x2: Int, _ y2: Int) -> Int {
    return abs(x1 - x2) + abs(y1 - y2)
}
func euclideanDistance(_ x1: Int, _ y1: Int, _ x2: Int, _ y2: Int) -> Double {
    return sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2)
}
/*************** メインプログラム ***************/

let (A, B, N) = *readIntsSplit().map{Double($0)}

var x = min(B-1, N)
print(Int((A*x)/B))


// let (a,b,n) = cin.triple
let t = cin.triple
let a = Double(t.0)
let b = Double(t.1)
let n = t.2

let x: Double = 0
var mmax = 0

(1...n).map { Double($0) }.forEach { x in
    let res = Int(a*x/b) - Int(a)*Int(x/b)
    // print("x: \(x) -> r: \(res)")
    mmax = max(mmax, res)
}

print(mmax)

import Foundation
#if os(Linux)
    import Glibc
#else
    import Darwin.C
#endif

enum cin {
    // 123
    static var int: Int { Int(readLine()!)! }
    // 12 23
    static var pair: (Int, Int) { let line = readLine()!.components(separatedBy: " "); return (Int(line[0])!, Int(line[1])!) }
    // 12 23 34
    static var triple: (Int, Int, Int) { let line = readLine()!.components(separatedBy: " "); return (Int(line[0])!, Int(line[1])!, Int(line[2])!) }
    // AtCoder
    static var str: String { readLine()! }
    // At Coder
    static var arrayStr: [String] { str.components(separatedBy: " ") }
    // 1 2 3 4
    static var array: [Int] { str.components(separatedBy: " ").map { Int($0)! } }
    // 1
    // 2
    // 3
    static func v_array(count: Int) -> [Int] { (0..<count).map { _ in int } }
}

extension Int {
    // 123 -> [1, 2, 3]
    var digits: [Int] { Array(String(self)).map { Int(String($0))! } }
}

extension Array where Element == Int {
    // [2, 1, 3, 2] -> 8
    var sum: Int { self.reduce(0, +) }
    // [2, 1, 3, 2] -> [1, 2, 2, 3]
    var orderBy: [Int] { sorted() }
    // [2, 1, 3, 2] -> [3, 2, 2, 1]
    var orderByDesc: [Int] { sorted(by: { $0 > $1 }) }
    // [2, 1, 3, 2] -> [2, 1, 3]
    var distinct: [Int] { Array(Set(self)) }
}

extension String {
    // e.g. cin.line.regex(match: "^(dream|dreamer|erase|eraser)*$")
    func regex(match pattern: String) -> Bool {
        let regex = try! NSRegularExpression(pattern: pattern)
        return regex.firstMatch(in: self, range: NSRange(location: 0, length: self.count)) != nil
    }
    // "ABC"[1] -> "B"
    subscript(i: Int) -> Character {
        get {
            self[index(at: i)]
        }
        set(char) {
            var characters = Array(self)
            characters[i] = char
            self = String(characters)
        }
    }
    func index(at offset: Int) -> String.Index { index(startIndex, offsetBy: offset) }
    // "ABC".swapAt(0, 1) -> "BAC"
    mutating func swapAt(_ index1: Int, _ index2: Int) {
        var characters = Array(self)
        characters.swapAt(index1, index2)
        self = String(characters)
    }
}


// let (a,b,n) = cin.triple
let t = cin.triple
let a = Double(t.0)
let b = Double(t.1)
let n = Double(t.2)

let x: Double = 0
var mmax = 0

(1...10000).map { Double($0) }.forEach { x in
    let res = Int(a*x/b) - a*Int()
    print()
}

import Foundation
#if os(Linux)
    import Glibc
#else
    import Darwin.C
#endif

enum cin {
    // 123
    static var int: Int { Int(readLine()!)! }
    // 12 23
    static var pair: (Int, Int) { let line = readLine()!.components(separatedBy: " "); return (Int(line[0])!, Int(line[1])!) }
    // 12 23 34
    static var triple: (Int, Int, Int) { let line = readLine()!.components(separatedBy: " "); return (Int(line[0])!, Int(line[1])!, Int(line[2])!) }
    // AtCoder
    static var str: String { readLine()! }
    // At Coder
    static var arrayStr: [String] { str.components(separatedBy: " ") }
    // 1 2 3 4
    static var array: [Int] { str.components(separatedBy: " ").map { Int($0)! } }
    // 1
    // 2
    // 3
    static func v_array(count: Int) -> [Int] { (0..<count).map { _ in int } }
}

extension Int {
    // 123 -> [1, 2, 3]
    var digits: [Int] { Array(String(self)).map { Int(String($0))! } }
}

extension Array where Element == Int {
    // [2, 1, 3, 2] -> 8
    var sum: Int { self.reduce(0, +) }
    // [2, 1, 3, 2] -> [1, 2, 2, 3]
    var orderBy: [Int] { sorted() }
    // [2, 1, 3, 2] -> [3, 2, 2, 1]
    var orderByDesc: [Int] { sorted(by: { $0 > $1 }) }
    // [2, 1, 3, 2] -> [2, 1, 3]
    var distinct: [Int] { Array(Set(self)) }
}

extension String {
    // e.g. cin.line.regex(match: "^(dream|dreamer|erase|eraser)*$")
    func regex(match pattern: String) -> Bool {
        let regex = try! NSRegularExpression(pattern: pattern)
        return regex.firstMatch(in: self, range: NSRange(location: 0, length: self.count)) != nil
    }
    // "ABC"[1] -> "B"
    subscript(i: Int) -> Character {
        get {
            self[index(at: i)]
        }
        set(char) {
            var characters = Array(self)
            characters[i] = char
            self = String(characters)
        }
    }
    func index(at offset: Int) -> String.Index { index(startIndex, offsetBy: offset) }
    // "ABC".swapAt(0, 1) -> "BAC"
    mutating func swapAt(_ index1: Int, _ index2: Int) {
        var characters = Array(self)
        characters.swapAt(index1, index2)
        self = String(characters)
    }
}


func readInt(separator: Character) -> [Int] {
  return readLine()!.split(separator: separator).map { Int($0)! }
}
let abn = readInt(separator: " ")
let a = abn[0], b = abn[1], n = abn[2]
var maxValue = 0
var x = n
while x > 0 {
  let m = a*x / b - a * (x / b)
  let tmp = maxValue
  maxValue = max(m, maxValue)
  if tmp > maxValue { break }
  x -= 1
}
print(maxValue)


export class Main {
  static main(input: string): string {
    const tmp: string[] = input.split("\n");
    const [a, b, n]: number[] = tmp.shift().split(" ").map(int => parseInt(int));
    const x = Math.min(b - 1, n);
    return `${Math.floor(a * x / b) - a * Math.floor(x / b)}`;
  }
}
console.log(Main.main(require("fs").readFileSync("/dev/stdin", "utf8")));


import * as fs from "fs";

const input = (fs.readFileSync("/dev/stdin", "utf8") as string).split("\n");
const [a, b, n] = input[0].split(" ").map((x: string): number => +x);

const x = n < b ? n : b - 1;
console.log(Math.floor(x * a / b));


import * as fs from 'fs'
import {debug} from '../../../util'

const input = fs.readFileSync('/dev/stdin', 'utf8').split(' ').map(n => parseInt(n, 10))
const output = (x: any) => console.log(x)
// debug(input)
const [A, B, N] = input

const x = N < B ? N : B - 1
// debug(x)

const sum = Math.floor(A / B * x) - A * Math.floor(x / B)
output(sum)


import * as fs from 'fs'
import {debug} from '../../../util'

const input = fs.readFileSync('/dev/stdin', 'utf8').split(' ').map(n => parseInt(n, 10))
const output = (x: any) => console.log(x)
// debug(input)
const [A, B, N] = input

const x = N <= B ? N : B - 1
// debug(x)

const sum = Math.floor(A / B * x) - A * Math.floor(x / B)
output(sum)


import * as fs from 'fs'
import {debug} from '../../../util'

const input = fs.readFileSync('/dev/stdin', 'utf8').split(' ').map(n => parseInt(n, 10))
const output = (x: any) => console.log(x)
// debug(input)
const [A, B, N] = input

let x = B
for(let i = N; i >= 1; --i) {
    if (i < B) {
        x = i
        break
    }
}
// debug(x)

const sum = Math.floor(A / B * x) - A * Math.floor(x / B)
output(sum)


import * as fs from 'fs'

const input = (fs.readFileSync('/dev/stdin', 'utf8') as string).split('\n')
const [a, b, n] = input[0].split(' ').map((x: string): number => +x)

const result = [...new Array(n + 1)]
  .map((_, i) => Math.floor((i * a) / b) - a * Math.floor(i / b))
  .reduce((a, b) => Math.max(a, b))

console.log(result)


n,i=map(int,input().split())
print(n-i+1)


print(eval(input().replace(" ","-"))+1)


N, i = map(int, input().split())
print(N - i + 1)


print(1 - eval(input().replace(" ", "-")))


n,i=map(int,input().split())
print(n-i)


a,b=input().split()
print(int(a-b+1))


import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split(" ");
    int n = Integer.parseInt(str[0]);
    int i = Integer.parseInt(str[1]);
    System.out.println(n-i+1);
  }
}


import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main
{

  public static void main
  (
    String[] args
  )
  {
    BufferedReader in_stream;
    String         in_str;
    String[]       in_str_split;

    int in_N;
    int in_i;

    int ans;

    try
    {
      in_stream = new BufferedReader(new InputStreamReader(System.in));

      /*----------------
       * 引数
       *----------------*/
      in_str       = new String(in_stream.readLine());
      in_str_split = in_str.split(" ");
      in_N         = Integer.parseInt(in_str_split[0]);
      in_i         = Integer.parseInt(in_str_split[1]);

      /*----------------
       * 計算
       *----------------*/
      ans = in_N - in_i + 1;

      System.out.println(String.valueOf(ans));
    }
    catch(Exception e)
    {
      e.printStackTrace();
    }
  }
}


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

public class Main {

	BufferedReader br;
	PrintWriter out;
	StringTokenizer st;
	boolean eof;

	void solve() throws IOException {
		int n = nextInt();
		int i = nextInt();
		out.println(n - i + 1);
	}

	Main() throws IOException {
		br = new BufferedReader(new InputStreamReader(System.in));
		out = new PrintWriter(System.out);
		solve();
		out.close();
	}

	public static void main(String[] args) throws IOException {
		new Main();
	}

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

	String nextString() {
		try {
			return br.readLine();
		} catch (IOException e) {
			eof = true;
			return null;
		}
	}

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

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

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


import java.util.*; import java.io.*; import java.math.*;
public class Main{
	//Don't have to see. start------------------------------------------
	static class InputIterator{
		ArrayList<String> inputLine = new ArrayList<String>(1024);
		int index = 0; int max; String read;
		InputIterator(){
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			try{
				while((read = br.readLine()) != null){
					inputLine.add(read);
				}
			}catch(IOException e){}
			max = inputLine.size();
		}
		boolean hasNext(){return (index < max);}
		String next(){
			if(hasNext()){
				return inputLine.get(index++);
			}else{
				throw new IndexOutOfBoundsException("There is no more input");
			}
		}
	}
	static HashMap<Integer, String> CONVSTR = new HashMap<Integer, String>();
	static InputIterator ii = new InputIterator();//This class cannot be used in reactive problem.
	static PrintWriter out = new PrintWriter(System.out);
	static void flush(){out.flush();}
	static void myout(Object t){out.println(t);}
	static void myerr(Object t){System.err.print("debug:");System.err.println(t);}
	static String next(){return ii.next();}
	static boolean hasNext(){return ii.hasNext();}
	static int nextInt(){return Integer.parseInt(next());}
	static long nextLong(){return Long.parseLong(next());}
	static double nextDouble(){return Double.parseDouble(next());}
	static ArrayList<String> nextStrArray(){return myconv(next(), 8);}
	static ArrayList<String> nextCharArray(){return myconv(next(), 0);}
	static ArrayList<Integer> nextIntArray(){
		ArrayList<String> input = nextStrArray(); ArrayList<Integer> ret = new ArrayList<Integer>(input.size());
		for(int i = 0; i < input.size(); i++){
			ret.add(Integer.parseInt(input.get(i)));
		}
		return ret;
	}
	static ArrayList<Long> nextLongArray(){
		ArrayList<String> input = nextStrArray(); ArrayList<Long> ret = new ArrayList<Long>(input.size());
		for(int i = 0; i < input.size(); i++){
			ret.add(Long.parseLong(input.get(i)));
		}
		return ret;
	}
	static String myconv(Object list, int no){//only join
		String joinString = CONVSTR.get(no);
		if(list instanceof String[]){
			return String.join(joinString, (String[])list);
		}else if(list instanceof ArrayList){
			return String.join(joinString, (ArrayList)list);
		}else{
			throw new ClassCastException("Don't join");
		}
	}
	static ArrayList<String> myconv(String str, int no){//only split
		String splitString = CONVSTR.get(no);
		return new ArrayList<String>(Arrays.asList(str.split(splitString)));
	}
	public static void main(String[] args){
		CONVSTR.put(8, " "); CONVSTR.put(9, "\n"); CONVSTR.put(0, "");
		solve();flush();
	}
	//Don't have to see. end------------------------------------------
	static void solve(){//Here is the main function
      ArrayList<Integer> one = nextintArray();
      int N = one.get(0);
      int x = one.get(1);
      myout(N - x + 1);
	}
	//Method addition frame start

	//Method addition frame end
}


mport java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int i = sc.nextInt();
		sc.close();

		System.out.println(n + 1 - i);
	}
}


import java.util.*;
public class Main {
	public static void main(String[] args) throws Exception{
      Scanner scn = new Scanner(System.in);
      int h = scn.nextInt();
      int w = scn.nextInt();
      char[][] a = new char[h][w];
      for(int i=0; i<h; ++i){
        String str = scn.next();
        for(int j=0; j<w; ++j){
          a[i][j] = str.charAt(j);
        }
      }
      int[] hh = new int[h];
      int c = 0;
      for(int i=0; i<h; ++i){
        int count = 0;
        for(int j=0; j<w; ++j){
          if(a[i][j]=='.'){
            count = count + 1;
          }
        }
          if(count != w){
          	hh[c] = i;
            c = c + 1;
          }
      }
      int[] ww = new int[w];
      int d=0;
      for(int j=0; j<w; ++j){
        int count = 0;
        for(int i=0; i<h; ++i){
          if(a[i][j]=='.'){
            count = count + 1;
          }
        }
          if(count != h){
          	ww[d] = j;
            d = d + 1;
          }
      }
      for(int i=0; i<c; ++i){
        for(int j=0; j<d; ++j){
        	System.out.print(a[hh[i]][ww[j]]);
        	System.out.println();
        }
      }
    }
}


#include<stdio.h>

int main(void){
int n,i;
int c;
scanf("%d%d",&n,&i);
c=n-i+1;
printf("%d\n",c);

return 0;}


#include <iostream>
using namespace std;
int main(){

  int n,m;
  cin>>n>>m;

  cout<<n-m+1<<endl;

}


#include <iostream>
using namespace std;

int main(int argc, char *argv[])
{
    int a, b;
	cin >> a >> b;

	cout << (a - b) + 1;

	return 0;
}


#include <iostream>
#include <algorithm>
using namespace std;

int main()
{
	int n, i;
	cin >> n >> i;
	cout << n - i + 1;1
}


#include<iostream>
using namespace std;
int main (){
 int N,i,z;
 cin>>N>>i;
			  for(int x=N;x>=0;x--)
			 {
			 	if(x>=i)
			 	z++;
			 	else
			 	break;
			 }
			 cout<<z<<endl;
			 return 0;
}


#include <iostream>
#include <map>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <sstream>
#include <cmath>
#include <math.h>
#include <string>
using namespace std;
typedef long long ll;
#define rep(n) for( int i = 0 ; i < n ; i++ )
#define REP(n) for( int i = 1 ; i <= n ; i++ )
#define repll(n) for( ll i = 0 ; i < n ; i++ )
#define REPll(n) for( ll i = 1 ; i <= n ; i++ )
#define rep2(n) for( int j = 0 ; j < n ; j++ )
#define REP2(n) for( int j = 1 ; j <= n ; j++ )
#define repll2(n) for( ll j = 0 ; j < n ; j++ )
#define REPll2(n) for( ll j = 1 ; j <= n ; j++ )

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int a , b;
  	cin >> a;
  	cout << a - b + 1;
}


#include <stdio.h>
int main(void){

    int a, b;
    int result;

    scanf("%d %d", &a, &b);

    result=a-b+1;

    printf("%d\n", result);

    return 0;
}


#include <stdio.h>

int main(){
int n,i;
scanf("%d %d",&n,&i);
printf("%d",n - i + 1);
return 0;
}


i;main(n){scanf("%d%d",&n,&i);printf("%d",n-i+1);}


/* ex5_3
   tamayama */

#include<stdio.h>
#define SIZE 100

int main(void){
    int table_height,table_width;
    char table[SIZE][SIZE];
    int i,j,k,l,m,n,x,y;
    int count = 0;

    scanf("%d %d",&table_height,&table_width);   /*.や#を入力する*/
    for(i=0;i<table_height;i++){
        for(j=0;j<table_width;j++){
            scanf(" %c",&table[i][j]);
        }
    }
    for(i=0;i<table_height;i++){    /*.のみの行をxに変換する*/
        for(j=0;j<table_width;j++){
            if(table[i][j] == '.'){
                count++;
                if(count == table_width){
                    for(k=0;k<table_width;k++){
                        table[i][k] = 'x';
                    }
                }
            }
        }count = 0;
    }
    for(l=0;l<table_width;l++){    /*.またはxの行をxに変換する*/
        for(m=0;m<table_height;m++){
            if(table[m][l] == '.' || table[m][l] == 'x'){
                count++;
                if(count == table_height){
                    for(n=0;n<table_height;n++){
                        table[n][l] = 'x';
                    }
                }
            }
        }count = 0;
    }

    for(x=0;x<table_height;x++){    /*xを無視して出力する*/
        for(y=0;y<table_width;y++){
            if(table[x][y] != 'x'){
            printf("%c",table[x][y]);
            }
        }
        printf("\n");
    }
    return 0;
}


/*  ex4_4
    potter0723sw  */

#include <stdio.h>
#include <stdlib.h>

void werase(int *ptr, int *last, int eraser);//ptrは削除位置、lastは末尾位置、eraserは消す行の文字数
void erase(int *ptr, int *last);

int main(void){
    int height, width, i, j;
    char cell[10001];
    scanf("%d %d", &height, &width);

    for(i=0; i < height; i++){//マスの入力を受け取る
        for(j=0; j < width; j++){
            scanf("　%c", &cell[i*height+j]);
        }
    }

    for(i=0; i < height; i++){
        for(j=0; j < width; j++){
            if(cell[i * height+j] == '#'){//黒マス発見でループ脱出
                break;
            }
            if(j == width - 1){//最後のマスまで白なら行削除
                werase((int *)(1+ i * width),(int *)(width * height),width);
                height = height - 1;
            }
        }
    }

    for(j=0; j < width; j++){
        for(i=0; i < height; i++){
            if(cell[i * height+j] == '#'){//黒マス発見でループ脱出
                break;
            }
            if(j == height - 1){//最後のマスまで白なら行削除
                for(i=0; i < height; i++){
                    erase((int *)(1+ i * width + j),(int *)(width * height));
                }
                width = width - 1;
            }
        }
    }

    for(i=0; i < height; i++){
        for(j=0; j < height; j++){
            printf("%c", cell[i * height+j]);
        }
        printf("\n");
    }
}

void werase(int *wptr, int *wlast, int eraser){
    while(++wptr < wlast){
        *(wptr - eraser) = *wptr;//要素をひとつ前にずらす
    }
}

void erase(int *ptr, int *last){
    while(++ptr < last){
        *(ptr - 1) = *last;
    }
}


#include<stdio.h>
int main(void){
  int ab;
  scanf("%d%d",&a,&b);
  printf("%d",a-b+1);
  return 0;
}


function main(input) {
  var args = input.split(" ");
  var n = parseInt(args[0], 10);
  var i = parseInt(args[1], 10);
  console.log(n - i + 1);
}
main(require("fs").readFileSync("/dev/stdin", "utf8"));


function Main(input) {
    i = input.split(" ");
    console.log(i[0] - i[1] + 1);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


function main(input) {
  var N = input[0].split(" ")[0];
  var i = input[0].split(" ")[1];
  console.log(N-i+1);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8').trim().split("\n"))


const main = (arg) => {
  const lines = arg.trim().split('\n');
  const [N, i] = lines[0].map(Number);
  console.log(N - i + 1);
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


'use strict'
const main = argv => {
  onst input = argv.split(' ').map(value => parseInt(value))
  console.log(input[0] + 1 - input[1])
}

main(require("fs").readFileSync("/dev/stdin", "utf8"))


'use strict'
const main = argv => {
  onst input = argv.split(' ').map(value => Number(value))
  console.log(input[0] + 1 - input[1])
}

main(require("fs").readFileSync("/dev/stdin", "utf8"))


package main

import (
  "fmt"
)

func main() {
  var n, i int
  fmt.Scan(&n, &i)
  fmt.Println(n - i + 1)
}


package main

import (
	"fmt"
)

func main() {
	var n, i int
	fmt.Scan(&n, &i)

	fmt.Println(n - i + 1)
}


package main

import "fmt"

func main() {
	var n, i int
	fmt.Scan(&n, &i)
	fmt.Println(n-i+1)
}


package main

import (
	"fmt"
)

func main() {
	var n, i int
	fmt.Println(n - i + 1)
}


package main

import (
	"fmt"
)

func main() {
	var N, i int

	ans := N - i + 1

	fmt.Println(ans)
}


package main

import "fmt"

func main() {
	var i int
	fmt.Scan(&i)
	fmt.Println(101 - i)
}


a,b = gets.split.map(&:to_i)
puts a-b+1


n,i=gets.split.map(&:to_i);p (n + 1) - i


# abc107 A
n, i = gets.split.map(&:to_i)
p n - i + 1


a,b=gets.split.map &:to_i
puts b-a+1


def main():
    n,i = map(int,input().split())
    print(n-i+1)

if __name__ == '__main__':
    main()


N = get.chomp.to_s
n = get.chomp.to_s

puts "N - n"


use std::io::*;
use std::str::FromStr;

pub fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let a: usize = read();
    let b: usize = read();
    println!("{}", a - b + 1);
}


use std::io;

fn procon_read<T: std::str::FromStr>() ->  Vec<T> {
	let mut buf = String::new();
	io::stdin().read_line(&mut buf).expect("");
	let iter = buf.split_whitespace();
	let mut v: Vec<T> = Vec::new();
	for i in iter {
		v.push(i.parse().ok().unwrap());
	}
	v
}

fn main() {
	let v:Vec<i32> = procon_read();
	let n = v[0];
	let i = v[1];
	println!("{}", n - i + 1);
}


use std::io::Read;

fn main() {
    let mut buf = String::new();

    std::io::stdin().read_to_string(&mut buf).unwrap();

    let mut iter = buf.split_whitespace();
    let n: usize = iter.next().unwrap().parse().unwrap();
    let i: usize = iter.next().unwrap().parse().unwrap();
    println!("{}", n - i + 1);
}


use std::io::*;
use std::str::FromStr;

pub fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let a: usize = read();
    let b: usize = read();
    println!("{}", a - b + 1);
}
use std::io::*;
use std::str::FromStr;

pub fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let a: usize = read();
    let b: usize = read();
    println!("{}", a - b + 1);
}


macro_rules! get {
      ($t:ty) => {
          {
              let mut line: String = String::new();
              std::io::stdin().read_line(&mut line).unwrap();
              line.trim().parse::<$t>().unwrap()
          }
      };
      ($($t:ty),*) => {
          {
              let mut line: String = String::new();
              std::io::stdin().read_line(&mut line).unwrap();
              let mut iter = line.split_whitespace();
              (
                  $(iter.next().unwrap().parse::<$t>().unwrap(),)*
              )
          }
      };
      ($t:ty; $n:expr) => {
          (0..$n).map(|_|
              get!($t)
          ).collect::<Vec<_>>()
      };
      ($($t:ty),*; $n:expr) => {
          (0..$n).map(|_|
              get!($($t),*)
          ).collect::<Vec<_>>()
      };
      ($t:ty ;;) => {
          {
              let mut line: String = String::new();
              std::io::stdin().read_line(&mut line).unwrap();
              line.split_whitespace()
                  .map(|t| t.parse::<$t>().unwrap())
                  .collect::<Vec<_>>()
          }
      };
      ($t:ty ;; $n:expr) => {
          (0..$n).map(|_| get!($t ;;)).collect::<Vec<_>>()
      };
}

fn main() {
    // 入力
    let N = get!(i64);
    let p = get!(i64; N);

    let ans = p.iter().fold(0, |sum, a| sum + a.count);

    // 出力
    println!("{}", ans);
}