our visiting priest pointed out last week that 40 days is one of those numbers which to the Jews had special significance. The 40 years wandering in the desert signified the passage of an entire generation. 40 days or years is not an exact number, but a period of time necessary for a complete change or conversion from the old to the new, and the time of penance and fasting necessary for conversion, and the emptiness of self required for an encounter with the Divine.
Don’t get hung up on counting the days, that is taking something meant to be symbolic and interpreting it literally. Lent ends after the Mass of the Lord’s Supper on Holy Thursday and the Triduum begins, ending at midnight on Easter Sunday. Sundays are part of Lent, but even when fast and abstinence were the only prescribed penance, Sundays were exempt from those rules. At different peiords of time the length of Lent has varied, the pre-Lenten period, including day for beginning of lent has varied.