public boolean checkTru(String val, int thres) {
    int count = 0;
    for (int x = 0; x < val.length(); x++)
      if (val.charAt(x) == '4' || val.charAt(x) == '7')
        count++;

    return (count <= thres);
  }