Day 24: Santa's Little Helpers

It's Christmas Eve, and the elves are planning the routes for Santa! On his way to deliver presents, he can stop at either 1, 2 or 3 consecutive houses There must be a gap after this (denoted by a '.') before another block of houses The gap can be any size (any number of '.'s) The elves have planned the routes, but someone spilt hot chocolate over them! Some of the data has been salvaged, but other characters, marked by '?', are unreadable. The elves want to know how many distinct routes there are for each line of salvaged data A route where Santa visits no houses counts as 1 Each question mark can be replaced with either a house or a gap What is the sum of the number of possible routes for each line of the data? Here is your test input:

Example

Input

?.🏠🏠?..
?🏠.?.?
?.🏠🏠🏠..
🏠?🏠??🏠?🏠?
?..??
.🏠.?.
🏠??.?.?
🏠...🏠??
????🏠.🏠🏠?
?🏠🏠?.🏠🏠?

Output

91

Alert: You are about to download a file that contains details needed to find this geocache. As the geocache owner, I ensure that this file is safe to download. It has not been checked by Geocaching HQ or by the reviewer for possible malicious content. Download this file at your own risk.

Download input data:

Input Data File