Create capacity limitation for each Item in dropdown

I created a form and use this php code for create limitation registration in form:

$max = 1;
$user = JFactory::getUser();
$db   = JFactory::getDbo();
$query   = $db->getQuery(true);
$counter = $db->loadResult();
if ($counter >= $max){
  $formLayout = '<p style="color:red;">Sorry, you have reached the maximum number of submissions for this form.</p>';
global $database;
$database = JFactory::getDBO();
$database->setQuery("SELECT COUNT(`SubmissionId`) FROM #__rsform_submissions WHERE `formId`='25'");
if (intval($database->loadResult()) >= 33)
echo 'Dear user, Limitation of this group is full. Please try other Groups.';
$formLayout = '';

It work very exact.
But I have a dropdown list in this form. This php code just control limitation for all Item of dropdown list.
I need limitation for each item of dropdown in one form.


Registration capacity for item 1 is 33 user.
Registration capacity for item 2 is 23 user.
Registration capacity for item 3 is 13 user.

Each user just can fill this form for one time.

Form image is attached.

Please guide me.