use std::{collections::HashSet, io::Read}; fn main() { let mut s = String::new(); std::io::stdin().read_to_string(&mut s).ok(); let n: Vec = s.split_whitespace().flat_map(str::parse).collect(); let c = HashSet::<_>::from_iter(n[2..].iter()).len(); println!("{} {}", c, if n[0] == n[1] && c == 1 { 1 } else { 0 }) }