public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String line = "";
		char dates[] ;
		while ((line = in.readLine().trim()) != null) {
			int arr[] = atoi(line);
			int n = arr[0];
			int m = arr[1];
			int map[][] = new int[n + 2][m + 2];
			
			for (int i = 1; i < (map.length - 1); i++) {

				dates = in.readLine().trim().toCharArray();
				for (int j = 1; j < (map[i].length - 1); j++) {
					if (dates[j - 1] == '.') {
						map[i][j] = 0;
					}
					else if (dates[j - 1] == '/') {
						map[i][j] = 2;
					}else {
						map[i][j] = 1;
					}
				}
			}

			dfs(map, 0, 0);
			int a = 0;
			int b = 0;

			for (int i = 0; i < map.length; i++) {
				for (int j = 0; j < map[0].length; j++) {
					if (map[i][j] == 0) {
						b++;
					}
					if (map[i][j] != 3)
						a++;
				}
			}

			a -= b;
			System.out.println((a / 2) + b);
		}
	}