a = int(input())       
s = input()
count = 0                                                                                                                                         
for i in range(a-1): 
	if s[i] == '#' and s[i+1] == '.': 
		count += 1                                                                                                                                                 
print(count)                  