/*
import java.util.*;
class Solution {
public int[] solution(int[] progresses, int[] speeds) {
int[] answer = {};
return answer;
}
}
public class Main {
public Main() {
Scanner s = new Scanner(System.in);
int[] x = new int[100];
int[] y = new int[100];
int[] count = new int[100];
for(int i=0; i<100; i++) {
x[i] = s.nextInt();
}
for(int i=0; i<100; i++) {
y[i] = s.nextInt();
}
for(int i=0; i<100; i++) {
while(x[i]==100) {
x[i] += y[i];
count[i] ++;
}
}
}
public static void main(String[] args) {
new Main();
}
}
*/
import java.util.*;
class stack{
int top;
int [] stack;
int size;
int [] count1;
int count = 0;
private int x;
public stack(int size) {
this.size = size;
stack = new int[size];
top = -1;
}
public void push(int x) {
stack[++top] = x;
}
public void pop() {
stack[top--] = 0;
}
public void compare() {
int ptr =0;
int k=0;
int i=ptr;
while(ptr<top) {
while(stack[ptr]<=stack[i]) {
count ++;
i++;
if(stack[ptr]>stack[i]||i==top) {
count1[k]=count;
k++;
System.out.print(count);
break;
}
}
count = 0;
ptr ++;
i=ptr;
}
System.out.print(0);
}
}
public class Main{
public Main() {
Scanner x = new Scanner(System.in);
String str = x.nextLine();
int [] answer = {};
String[] str1 = new String[str.length()];
str1 = str.split(",");
stack s = new stack(10000);
answer = s.count1;
for(int i=0; i<str1.length; i++) {
s.push(Integer.valueOf(str1[i]));
}
s.compare();
System.out.print(answer);
}
public static void main(String[] args) {
new Main();
}
}