Counting matchings in graphs with applications to the monomer-dimer models