I need to create an HTML page, add three text boxes in which the user will input three numbers: `a`, `b`, `c`.

Then I'll have a button that, on click, will calculate the maximum number of the three. The result will be displayed in an alert. The program should not crash if the user does not input one or two numbers. 

Cases: 

* If no number is introduced then a message should be displayed asking the user to input at least one number.
* If only one number of the three is introduced, that number is the maximum number.
* If two numbers are introduced then it should be displayed the maximum of the two.
* If three numbers are introduced then it should be displayed the maximum of the three.

I get `NaN` alert popup, but I need an alert displaying `"input at least one number"`. This is what I've tried:

```js
function max() {
  var a = parseInt(document.getElementById("num1").value);
  var b = parseInt(document.getElementById("num2").value);
  var c = parseInt(document.getElementById("num3").value);
  var max = 0;

  var end = Math.max(a, b, c) || Math.max(a, b) || Math.max(a) || Math.max(a, c) || Math.max(b, c);

  alert(end);

  nbs = [a, b, c].filter(nb => !isNaN(nb));

  if (isNaN(a) && isNaN(b) && isNaN(c)) {
    alert("Input at least one number");
  } else {
    console.log(Math.max(nbs));
  }
}

```

What should I do?