#!/usr/bin/env python3
# -*- coding: utf-8 -*-


def main():
	n = int(input())
	s = input()
	ans = 0
	tmp = s[0]
	for i in range(0, n-1):
		if s[i] == '#' and s[i+1] == '.':
			ans += 1


	print(ans)

	
if __name__ == '__main__':
	import sys
	sys.exit(main())
