c    @(#)ncheck.f	1.1
c
      function ncheck (n)
      np = n
  101 k = np/2
      if (2*k.ne.np) go to 102
      np = k
      go to 101
  102 if (np.ne.1) go to 103
      ncheck = 0
      return
  103 k = np/3
      if (3*k.ne.np) go to 104
      np = k
      go to 103
  104 k = np/5
      if (5*k.ne.np) go to 105
      np = k
      go to 104
  105 if (np.ne.1) go to 106
      ncheck = 1
      return
  106 ncheck = 2
      return
      end
