#![allow(non_snake_case, unused_must_use, unused_imports)] use std::io::{self, prelude::*}; fn main() { let (stdin, stdout) = (io::read_to_string(io::stdin()).unwrap(), io::stdout()); let (mut stdin, mut buffer) = (stdin.split_whitespace(), io::BufWriter::new(stdout.lock())); macro_rules! input { ($t: ty, $n: expr) => { (0..$n).map(|_| input!($t)).collect::>() }; ($t: ty) => { stdin.next().unwrap().parse::<$t>().unwrap() }; } let A = input!(u32); let B = input!(u32); let C = input!(u32); let D = input!(u32); for n in 0.. { if A * n <= C && B * n <= D { continue; } writeln!(buffer, "{}", n - 1); break; } }