// Arup Guha
// 1/18/2014
// Solution to 2006 MCPC Problem B: Linear Pachinko

import java.util.*;

public class b {

	public static void main(String[] args) {

		Scanner stdin = new Scanner(System.in);
		String s = stdin.nextLine();

		// Go through each case.
		while (!s.equals("#")) {

			double prob = 0;
			int n = s.length();

			// Sum over ball falling at each slot.
			for (int i=0; i<n; i++) {

				// Run each case, calling our recursive function if necessary.
				char c = s.charAt(i);
				if (c == '/')
					prob += 1.0/n*score(s,i-1,-1);
				else if (c == '\\')
					prob += 1.0/n*score(s,i+1,1);
				else if (c == '.')
					prob += 1.0/n;
				else if (c == '|')
					prob += (0.5/n*score(s,i-1,-1) + 0.5/n*score(s,i+1,1));
			}

			// Output result as desired int.
			System.out.println( (int)(100*prob+1e-10));
			s = stdin.nextLine();
		}
	}

	public static int score(String s, int index, int dir) {

		// Take care of out of bounds.
		if (index < 0 || index >= s.length()) return 1;
		char c = s.charAt(index);

		// Other base cases.
		if (c == '.') return 1;
		if (c == '|' || c == '/' || c == '\\') return 0;
		
		// Recursive case where ball rolls on.
		return score(s, index+dir, dir);
	}
}