pub trait Graph<'a> {
    type Edge: 'a;
    type DIter: Iterator<Item = &'a (usize, Self::Edge)>;
    fn vertices(&self) -> usize;
    fn delta(&'a self, v: &usize) -> Self::DIter;
}

pub struct DirectedGraph<E> {
    g: Vec<Vec<(usize, E)>>
}

impl<'a, E: 'a> Graph<'a> for DirectedGraph<E> {
    type Edge = E;
    type DIter = std::slice::Iter<'a, (usize, E)>;
    fn vertices(&self) -> usize {
        self.g.len()
    }
    fn delta(&'a self, v: &usize) -> Self::DIter {
        self.g[*v].iter()
    }
}

impl<E> DirectedGraph<E> {
    pub fn new(n: usize) -> Self {
        DirectedGraph { g: (0..n).map(|_| Vec::new()).collect() }
    }
    pub fn from_iter(n: usize, iter: impl IntoIterator<Item = (usize, usize, E)>) -> Self {
        let mut g = Self::new(n);
        for (f, t, e) in iter {
            g.add_edge(f, t, e);
        }
        g
    }
    pub fn add_edge(&mut self, from: usize, to: usize, e: E) {
        self.g[from].push((to, e));
    }

    pub fn dfs(&self, v: &usize, p: &usize) -> u64 {
        let mut ans = 0u64;
        let mut zeros = 0u64;
        for (t, _) in self.delta(&v) {
            if t == p { continue }
            let res = self.dfs(t, v);
            ans += res;
            if res == 0 { zeros += 1 }
        }
        if zeros > 1 { ans += zeros - 1 }
        ans
    }
}

fn main() {
    ioset! { inp, buf }
    macro_rules! scan {
        ($($r:tt)*) => {
            input! { inp, $($r)* }
        }
    }
    macro_rules! print {
        ($($t:expr),*) => {
            write!(buf, $($t),*).unwrap();
        } 
    }

    scan! {
        n: usize,
        es: [(usize, usize); n - 1],
    }
    let mut deg = vec![0; n];
    let mut g = DirectedGraph::new(n);
    for &(a, b) in es.iter() {
        g.add_edge(a, b, ());
        g.add_edge(b, a, ());
        deg[a] += 1;
        deg[b] += 1;
    }
    let root = (0..n).max_by_key(|&v| deg[v]).unwrap();
    let ans = if deg[root] <= 2 {
        1
    }
    else {
        g.dfs(&root, &n)
    };
    print!("{}\n", ans);
}


use std::io::{ stdout, BufWriter, Write };

#[macro_export]
macro_rules! ioset {
    ($inp:ident, $buf:ident) => {
        inset!($inp);
        outset!($buf);
    }
}

#[macro_export]
macro_rules! inset {
    (source = $s:expr, $iter:ident) => {
        let mut $iter = $s.split_whitespace();
    };
    ($iter:ident) => {
        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();
    }
}

#[macro_export]
macro_rules! input {
    ($iter:expr) => {};
    ($iter:expr, ) => {};
    ($iter:expr, $var:ident : $t:tt, $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input! { $iter, $($r)* }
    };
    ($iter:expr, mut $var:ident : $t:tt, $($r:tt)*) => {
        let mut $var = read_value!($iter, $t);
        input! { $iter, $($r)* }
    };
    ($iter:expr, ($var:expr) : $t:tt, $($r:tt)*) => {
        $var = read_value!($iter, $t);
        input! { $iter, $($r)* }
    };
}

#[macro_export]
macro_rules! read_value {

    // tuple
    ($iter:expr, ( $($t:tt), * )) => {
        ( $(read_value!($iter, $t)), * )
    };
    
    // array
    ($iter:expr, [ $t:tt; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };
    
    // string
    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };
    
    // any other
    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

#[macro_export]
macro_rules! outset {
    ($buf:ident) => {
        let sout = stdout();
        let mut $buf = BufWriter::new(sout.lock());
    }
}

#[macro_export]
macro_rules! output {
    ($buf:expr, $($t:expr),*) => {
        write!($buf, $($t),*).unwrap();
    }
}

struct Chars<'a>(&'a Vec<char>);

impl<'a> std::fmt::Display for Chars<'a> {
    fn fmt(&self, f: &mut std::fmt::Formatter) -> Result<(), std::fmt::Error> {
        write!(f, "{}", self.0.iter().collect::<String>())
    }
}


Measured memory_bytes: 15268