def total_examples(X):
  """Counts the total number of examples of a sharded and sliced data object X."""
  count = 0
  for i in range(len(X)):
    for j in range(len(X[i])):
      count += len(X[i][j])
  return count