I'm looking for some pointers about a dynamic programming problem. I cannot find any relevant information about how to solve this kind of problem. 

Problem 

```
 A number is called a special number if it doesn't contain 3 consecutive 
 zeroes. i have to calculate the number of positive integers of exactly d digits 
 that are special answer should be modulo 1000000007(just for overflow in c++).

```

Problem can easily solved by permutation and combination but i want it with dynamic programming. 
I am unable to find its optimal substructure or bottom to top approach.