A sequence of ten letters has the following properties:
* Each letter is A, B, C, D, or E.
* The only letters that can come directly after A are B and C.
* The only letters that can come directly after B are C and D and E.
* The only letters that can come directly after C are A and B.
* The only letters that can come directly after D are E and A and C.
* The only letters that can come directly after E are A and B and D.
* The first, fourth, and tenth letters are B.
How many different sequences satisfy these properties?