A,B = gets.split.map(&:to_i) V = [A, B].minmax[A == 4 && B == 7 || A == 7 && B == 4 ? 0 : 1] puts V