If you have the day of week in A1, month in B1 and year in C1 then this formula will give the number of days

=4+(DAY(DATE(C1,B1,35))<WEEKDAY(DATE(C1,B1,0)-A1))