PROGRAM c164

IMPLICIT NONE
INTEGER:: i, j, k, N
CHARACTER :: a(1:N)

k = 1

READ *, N
DO i = 1, N
	READ *, a(i)
END DO

DO j = 2, N-1
	IF ( a(j) == a(j-1) ) THEN
    	k = k + 1
    END IF
END DO

PRINT *, k

END PROGRAM c164