/*CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
C                                                                             C
C  COMPUTE NUMBER OF FRACTIONS						      C
C  12/19/14 (DKC)							      C
C                                                                             C
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC*/
#include <math.h>
#include <stdlib.h>
unsigned int haros8(unsigned int N, unsigned int H, unsigned int K,
		    unsigned int HP, unsigned int KP, unsigned int D,
		    unsigned int *ND);
void mertenav(unsigned int N, unsigned int *count, unsigned int I) {
unsigned int J,ND[4];
J=I/2;
if (N<=J) {
   count[0]=0;
   count[1]=0;
   count[2]=0;
   count[3]=0;
   return;
   }
if ((N>=(J+1))&&(N<I)) {
   count[0]=0;
   count[1]=0;
   count[2]=0;
   count[3]=N-J;
   return;
   }
if (N==I) {
   count[0]=0;
   count[1]=0;
   count[2]=0;
   if ((I&1)==0)
      count[3]=J-1;
   else
      count[3]=J;
   return;
   }
if (N>I) {
   haros8(N,0,1,1,N,I,ND);
   count[0]=ND[2];
   count[1]=ND[3];
   if ((I&1)==0)
      haros8(N,1,I,ND[0],ND[1],J,ND);
   else
      haros8(N,1,I,ND[0],ND[1],I,ND);
   count[2]=ND[2];
   count[3]=ND[3];
   return;
   }
return;
}