Reading signal frequency

I try to connect as u suggested but no luck. or is it possible because i connect wrong pin? i looked the code again and there is no mention about pin 8 as an input.