i need ur help for formula for this problem, i have tried myself but still no success

say example, i need serial number in Column A, e.g 01, 02, 03, 04 and so on but with 2 conditions
in column B , there are fruits e.g B1 = Apple, B2= Mango, B3=Mango, B4= Apple, B5= Mango
and in Column C, there r months, e.g , C1= Jan-2013, C2= Jan-2013, C3= Jan-2013,C4 = Jan-2013, C5= Feb-2013
The result of serial number i want in Column A is A1=01, A2=02, A3=02, A4= 01, A5=03,

it means, if there is jan-2013 and irrespective of how many times apple come in jan-2013, the serial number must be always 01 and the serial number of new fruit after the first one e.g mango here must be 02, mango is also coming 2nd time in jan-2013, that's why its serial # is again 02 but if the same fruit e.g mango is coming in other month, serial must start in sequence, here mango is coming third time in Feb-2013, now its serial # is 03
hope u got my point
plz provide me the formula to solve this problem,
Thank u so much
waiting for ur respone