import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.UncheckedIOException; import java.util.stream.Stream; class Main { public static void main(String[] args) { no46(); } // はじめのn歩 private static void no46(){ BufferedReader reader = new BufferedReader(new InputStreamReader(System.in)); // 一歩 int a; // 区間 int b; try { String A = reader.readLine(); a = Integer.parseInt(A); String B = reader.readLine(); b = Integer.parseInt(B); reader.close(); } catch (IOException e) { throw new UncheckedIOException(e); } System.out.println((b / a) + (a % b)); } }