How to count the number of values in a multi value field with the Paragraphs module? I’m currently using the Paragraphs module. I have pretty much set up a simple bundle with a title, image and text area. I went into the basic page content type and added the paragraph field reference which worked fine. This had a limit of up to 6 paragraphs per basic page. They can add less than 6, just not any more than 6.

My question is, how do I count how many paragraphs have been entered on that particular basic page. I’m trying to count the amount of paragraphs added so each time it’s added it can dynamically modify the class containing the paragraph. 

For example, using Foundation 5 I want to count how many entries have been made and if there is 3 paragraphs then I want the name of the class to be foo for example.
If you're theming the paragraph field using a theme template or a preprocess function, an $id or $variables['id'] variable is available that has the count of the current paragraph item.