Let a1,a2,a3......... are in G.P. ar denote of G.P. Sr denotes sum to r terms of G.P. If a1=3,an=96,Sn=189 then n is