1111111111111111111111111111111111111111111
//#include <stdio.h>
//#include <stdlib.h>
//int main()
//{
// int a,b,c[10000][2]={},i,k,j,l,t=-1,max=-1,x,z,y;
// scanf("%d %d",&a,&b);
// for(i=0;i<a;i++)
// scanf("%d %d",&c[i][0],&c[i][1]);
// for(k=0;k<a;k++) {
// t=0;
// for(i=0;i<a;i++) {
// if(i==k)
// continue;
// if(b>=2)
// {
// t=0;
// for(j=0;j<a;j++) {
// if(j == k || j == i)
// continue;
// if(b==3)
// {
// t=0;
// for(l=0;l<a;l++) {
// if(l == k || l == j || l == i)
// continue;
//
// x = abs(c[k][0] - c[l][0]) + abs(c[k][1] - c[l][1]);
// y = abs(c[i][0] - c[l][0]) + abs(c[i][1] - c[l][1]);
// z = abs(c[j][0] - c[l][0]) + abs(c[j][1] - c[l][1]);
// if(y < x && y < z && t < y)
// t=y;
// else if(x < z && x < y && t < x)
// t=x;
// else if(t < z && z < x && z < y)
// t=z;
// }
// if(t < max || max == -1)
// max = t;
// }
// else {
// x = abs(c[k][0] - c[j][0]) + abs(c[k][1] - c[j][1]);
// y = abs(c[i][0] - c[j][0]) + abs(c[i][1] - c[j][1]);
// if(y < x && t < y)
// t=y;
// else if(x < y && t < y)
// t=x;
// }
// }
// if(t < max || max == -1)
// max = t;
// }
// else {
// x = abs(c[k][0] - c[i][0]) + abs(c[k][1] - c[i][1]);
// if(t < x) {
// t=x;
// }
// }
// }
// if(t < max || max == -1)
// max = t;
// }
// printf("%d",max);
// return 0;
//}
//#include <stdio.h>
//#include <stdlib.h>
//int n, k;
//int x[50]={},y[50]={};
//
//
//int dis(int a, int b, int c) // 대피소를 a, b, c 번째 집으로 정했을때, 최대 거리 리턴
//{
// int z,s,v,t=0, tmp;
// for(int i=0;i<n;i++)
// {
// if(i==a || i==b || i == c) {
// continue;
// }
// z = abs(x[i] - x[a]) + abs(y[i] - y[a]);
// s = abs(x[i] - x[b]) + abs(y[i] - y[b]);
// v = abs(x[i] - x[c]) + abs(y[i] - y[c]);
//
// tmp = (z<s?z:s)<v?(z<s?z:s):v;
// t = tmp>t ? tmp : t;
// //printf("t : %d (%d %d %d)(%d %d %d)\n",t,a,b,c,z,s,v);
// //i와 a, b, c의 최대거리
// }
// return t;
//
//}
//
//int main()
//{
// int i,j,l,t=-1,max=938498,b;
// scanf("%d %d",&n,&k);
// for(i=0;i<n;i++)
// scanf("%d %d",&x[i],&y[i]);
//
// if(k==1)
// {
// for(i=0;i<n;i++)
// {
// b = dis(i,i,i);
// if(max > b) {
// max = b;
// }
// }
// }
// else if(k==2)
// {
// for(i=0;i<n;i++) {
// for(j=0;j<n;j++) {
// if(j==i)
// continue;
// //printf("start\n");
// b = dis(i,j,i);
// if(max > b) {
// max = b;
// }
// }
// }
// }
//
// else if(k==3) {
// for(i=0;i<n;i++) {
// for(j=0;j<n;j++) {
// if(j==i)
// continue;
// for(l=0;l<n;l++) {
// if(l==i || l == j)
// continue;
// b = dis(i,j,l);
// if(max > b) {
// max = b;
// }
// }
// }
// }
// }
// printf("%d",max);
//
// return 0;
//}
#include <stdio.h>
int a,b;
int dubae()
{
int i=0;
while(b > a) {
b *= 2;
i++;
}
return i;
}
int main()
{
int n,i,c=0;;
scanf("%d",&n);
scanf("%d",&a);
b=a;
for(i=0;i<n-1;i++) {
scanf("%d",&a);
if(b > a) {
c += dubae();
}
}
printf("%d",c);
}




