import std.stdio;
import std.string;
import std.conv;
import std.algorithm;

void main() {
    int[] buf = readln.chomp.split.to!(int[]);
    int a = buf[0], b = buf[1];
    int ans = a - 1 + (a <= b ? 1 : 0);

    writeln(ans);
}