The human genome consists of 24,000 genes (approx) half inherited from your mother and half from your father (again, approximately.)
So your parents each gave you 12,000 genes, your grand-parents (of whom there were four) each gave you 6,000 genes; your great grand-parents (8) contributed 3,000 each, and so on back through the generations.
But if we go back 300 or 400 years, say 15 generations, then each of your 32,768 ancestors contributed less than one gene to your make-up, ie zero genes, so some of them are not really your ancestors at all.
There are a couple of exceptions...
If you are male then you have a Y chromosome containing 45 genes. You got this from your father (obviously, since your mother didn't have one) and he got it from his father in an unbroken chain back through the generations to the dawn of time, ie, whenever the current genetic set up was started.
There are also 13 mitochondrial genes. Both male and female have these but they are inherited only from the mother so also form an unbroken chain into the past.