This quote
under the 183-day rule to count as a day any day upon which an individual is in the UK at the end of that day (i.e. at midnight)
comes directly from the HMRC's own guidance -
To me that is pretty clear that your example would equal
three days (ie midnights) in the UK