Hide div based on minimum number checkboxes selected

Hide div based on minimum number checkboxes selected

I wan to show hide divs based on total number of checkboxes selected in the html below. I want to ..

1. Hide div.cart if total no. of checkboxes selected is less than 3 and show div.notice
2. If total no. of boxes selected is greater than 3 hide div.notice and show div.cart. 

To sum if up div.cart show only be visible if user has checked 3 or more boxes, if not than user can only see div.notice telling them to select more.


<input type="checkbox">
<input type="checkbox">
<input type="checkbox">
<input type="checkbox">
<input type="checkbox">

<div class="cart"> Cart Total </div>
<div class="notice">Please select atleast 3 </div>