bemDepth = function (str) {
  var elements = str.split('__').length;

  if (elements >= 2) {
    return elements - 1;
  }

  return 0;
}
Get number of BEM elements in
@param   {string}  str String representing a class selector
@returns {integer}     Number of BEM elements in str