// https://atcoder.jp/contests/arc088/tasks/arc088_d
//
#![allow(unused_imports)]
use std::io::*;
use std::fmt::*;
use std::str::*;
use std::cmp::*;
use std::collections::*;

macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, [ next / $t:tt ]) => {
        {
            let len = read_value!($iter, usize);
            (0..len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
        }
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_macros)]
macro_rules! dvec {
    ($t:expr ; $len:expr) => {
        vec![$t; $len]
    };

    ($t:expr ; $len:expr, $($rest:expr),*) => {
        vec![dvec!($t; $($rest),*); $len]
    };
}

#[allow(unused_macros)]
macro_rules! ifv {
    ($t:expr, $a:expr, $b: expr) => {
        if $t { $a } else { $b }
    }
}

#[allow(unused_macros)]
macro_rules! fill {
    ($t:expr, $v:expr) => {
        for i in 0..$t.len() {
            $t[i] = $v;
        }
    };
}

#[allow(unused_macros)]
macro_rules! join {
    ($t:expr, $glue:expr) => {
        $t.into_iter().map(|w| w.to_string()).collect::<Vec<_>>().join($glue)
    };
}

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        println!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

type Graph = Vec<Vec<usize>>;

const INF: usize = 100000000;

fn combine(c: &Vec<usize>, limit: usize) -> usize {
    let n = c.len();
    let mut count = 0;
    let mut fr = 0;
    let mut to = n-1;
    while fr <= to {
        if c[fr] == INF {
            fr += 1;
            continue;
        }
        if c[to] == INF {
            to -= 1;
            continue;
        }
        if fr == to {
            count += 1;
            break;
        } else {
            count += 1;
            if c[fr] + c[to] > limit {
                to -= 1;
            } else {
                fr += 1;
                to -= 1;
            }
        }
    }
    count
}

fn combine_except(c: &mut Vec<usize>, i: usize, limit: usize) -> usize {
    let tmp = c[i];
    c[i] = INF;
    let r = combine(&c, limit);
    c[i] = tmp;
    r
}

fn dfs(now: usize, par: Option<usize>, limit: usize, g: &Graph) -> (usize, usize) {
    let mut children = vec![];

    let mut total_count = 0;
    for &to in &g[now] {
        if Some(to) == par {
            continue;
        }
        let (len, count) = dfs(to, Some(now), limit, g);
        assert!(len <= limit);
        if len == limit {
            total_count += count + 1;
        } else {
            total_count += count;
            children.push(len);
        }
    }
    if children.len() == 0 {
        return (1, total_count);
    }

    children.sort();

    let cn = children.len();
    let best0 = combine(&children, limit);
    let mut wbest = combine_except(&mut children, cn-1, limit);
    let mut ok = (cn-1) as i32;
    let mut ng = -1;

    while ok - ng > 1 {
        let med = (ok + ng) / 2;
        assert!(med >= 0);
        if wbest == combine_except(&mut children, med as usize, limit) {
            ok = med;
        } else {
            ng = med;
        }
    }
    if best0 == wbest {
        (1, total_count + best0)
    } else {
        (children[ok as usize] + 1, total_count + wbest)
    }
}

fn isok(a: usize, b: usize, g: &Graph) -> bool {
    let (tail, count) = dfs(0, None, b, g);
    count + ifv!(tail >= 2, 1, 0) <= a
}

fn solve(a: usize, g: Graph) -> usize {
    let mut ok = g.len();
    let mut ng = 0;
    while ok - ng > 1 {
        let med = (ok + ng) / 2;
        if isok(a, med, &g) {
            ok = med;
        } else {
            ng = med;
        }
    }
    ok
}

fn main() {
    input! {
        n: usize,
        edges: [(usize1, usize1); n-1]
    };

    let mut g = vec![vec![]; n];
    for (u, v) in edges {
        g[u].push(v);
        g[v].push(u);
    }
    let mut odddeg = 0;
    for i in 0..n {
        if g[i].len() % 2 == 1 {
            odddeg += 1;
        }
    }
    assert!(odddeg % 2 == 0);
    let a = odddeg / 2;
    let b = solve(a, g);
    println!("{} {}", a, b);
}


Measured memory_bytes: 37116