I would suggest doing something along these lines.
string[] input = "02-08-2025 04-09-2025".Split(' ');
DateTime startDate = DateTime.Parse(input[0]);
DateTime endDate = DateTime.Parse(input[1]);
int luckyNumberCount = 0;
for (DateTime date = startDate; date <= endDate; date = date.AddDays(1))
{
var n = int.Parse(date.ToString("dd-MM-yyyy").Replace("-", ""));
if (n % 4 == 0 || n % 7 == 0) luckyNumberCount++;
}
Console.WriteLine(luckyNumberCount);
Console.ReadLine();