#include <bits/stdc++.h>
using namespace std;
char str[100002] = {'\0'};
int main() {
  int i, len;
  int a = 0, b = 0;
  int ans = 0;
  scanf("%s", str);
  len = strlen(str);
  for (i = 0; i < len; i++) {
    if (str[i] == '0') {
      ans += b;
      a++;
    } else if (str[i] == '1') {
      ans += a;
      b++;
    }
  }
  printf("%d\n", ans);
  return 0;
}
