As it is stated in the European Commission website:
DURATION OF STAY………DAYS indicates the number of days you may stay in
the Schengen area. The days should be counted from the date you enter
the Schengen area (the entry stamp) to the date you exit the Schengen
area (the exit stamp), i.e. both days included.
So, it doesn't depend on the country, it's counted from the date of entry to the Schengen area till the date of exit out of the Schengen area. In your case that makes 10 days.
The period of time between "FROM …UNTIL" is usually longer than the
number of days printed in the "DURATION OF STAY" field. The difference
in period is meant to give you flexibility to plan your entry into and
exit from the Schengen area, but your stay in the Schengen area must
never exceed the exact number of days in the "DURATION OF STAY …DAYS"
As your planned stay in Schengen area (10 days) exceeds your allowed duration of stay in Schengen area (8 days), it is a problem and you should consider to reschedule your trip.