Anya uses the following procedure to write down a sequence of numbers. First she chooses the first term to be 5. To generate each succeeding term, she flips a fair coin. If it comes up heads, she doubles the previous term and subtracts 1. If it comes up tails, she takes half of the previous term and subtracts 1. What is the probability that the fourth term in Anya's sequence is an integer?