numbers starting with 978 => 987_ _ _ _ _ _ _ => 7!
numbers having 45 in 5th and 6th position => _ _ _ _ 45_ _ _ _ => 8!
numbers ending with 123=7!
numbers starting with 978 and having 45 in 5th and 6th position=98745_ _ _ _ _ =>5!
numbers starting with 978 and ending with 123 => 978 _ _ _ _ 123 =>4!
numbers having 45 in 5th and 6th position and ending with 123 => _ _ _ 45 _ _ 123 =>5!
numbers starting with 978, having 45 in 5th and 6th position and ending with 123 => 98745_ _ 123 =>2!
7!+8!+7!-5!-4!-5!+2!
=50,138