How many five-digit numbers are there for which each digit is either equal to both adjacent ones, or differs from its neighbors exactly by 1 (from one smaller by 1, and from the other larger by 1) and which contain the digit 5?