Will OPT stay get counted in my remaing H1B stay

I have already stayed with my L1b for 3 yrs 8 months before getting rejected for extension.Meanwhile I got a H1B approved but had to come back in july 2011 since it was getting effective from 2011 oct.After that I applied for MS for fall 2012 and got accept from a lower ranked university.I am planning to go back to usa with the h1b around july/august and apply for some better universities for spring 2013.My question is with my present h1b if I change status to f1 while staying in usa around feb 2013 what duration I will be getting when I will apply for a h1b after completion of my MS.

Will the stay with opt(normally 12 months and with extn 29 months) be counted when the new h1b given to me.So to make things clear what would be the case

1.2.5 yrs for opt+6 yrs h1b

2.2.5 yrs of opt+2 yrs of h1b (if they will count my earlier stay)

3.Only 2.5yrs for opt and they won't give me h1b since 2.5 yrs opt+ earlier stay of 3 yrs 8 months sums above 6 yrs

As far as I know, OPT is actually F1 status and thus won’t be counted against the H1B/L1 time.

Also, the L1 duration won't be counted if you have stayed outside US for more than 1 year after the L1 tenure.

Could you please provide the dates of your L1 stay and the H1B approval?

Sujith,thanks a lot for your answer!
My L1 was issued in 2007 October,I came to us on 2007 December.
My L1 was valid till 2010 July but the I94 was valid till 2011 June hence
I applied for L1 extension and got the rejection in 18th July 2011 and got the approval for H1 on 6th July 2011.However since it was getting effective from 2011 October I came back on 29th July.The H1 is valid till 2013 December and I might go back to USA on July 2012 and if I get a spring admission I will apply for H1 to F1 status change.I guess after my MS if I apply for a H1 they will count the initial 3 yrs 8 months stay and 2012 july to 2013 january stay.

I think, you could get complete 6 years on H1B if you were out of US since 29th July 2011 and will not go back until end of this July (you need to be out of US for continuous 1 year to have your H1B/L1 clock reset). Plan for travel in August or later.