Somthing like this?
relevant_months %>% gather("month", "flag", -count) %>% summarise(count = sum(count * (flag == "y")), .by = "month")