Ishaan has N dollars in his bank account. He wants to withdraw all of it. But the bank has a policy that the amount withdrawn must be a divisor of the current amount **(except the amount itself)**.

Ishaan wants his money as soon as possible, so he withdraws the maximum amount from his bank each day. Determine the number of days he will need to withdraw all of his money.

**Note :** If the remaining amount is 1, he can withdraw it.

**Input : **

First line of input contains a single integer T denoting the number of test cases.The only line of each test case contains an integer N.

**Output : **

For each test case, print the required answer in a new line.

**Constraints : **

1 <= T <= 200

1 <= N <= 10^{12}

**Example :
Input : **

3

12

21

9

5

7

5

**Explanation :
Case 1 : **

N = 12

Remaining = 6

Remaining = 3

Remaining = 2

Remaining = 1

Remaining = 0

**Case 2 : **

N = 21

**Withdraws 7**

Remaining = 14

**Withdraws 7**

Remaining = 7

**Withdraws 1**

Remaining = 6

**Withdraws 3**

Remaining = 3

**Withdraws 1**

Remaining = 2

**Withdraws 1**

Remaining = 1

**Withdraws 1**

Remaining = 0

**Case 3 : **

N = 9

**Withdraws 3**

Remaining = 6

**Withdraws 3**

Remaining = 3

**Withdraws 1**

Remaining = 2

**Withdraws 1**

Remaining = 1

**Withdraws 1**

Remaining = 0

Author: goyalanubhav11

If you have purchased any course from GeeksforGeeks then please ask your doubt on course discussion forum. You will get quick replies from GFG Moderators there.

Sulagna | 117 |

RUTVIKHARIPARA | 116 |

janvidavda105190 | 93 |

harshsiddhapura105461 | 93 |

devsinghindra | 80 |

PiyushPandey4 | 614 |

ASWATHAMA | 561 |

akhyasharma01 | 547 |

john_wick | 521 |

jagrit_07 | 443 |

blackshadows | 5362 |

Ibrahim Nash | 5242 |

akhayrutdinov | 5111 |

mb1973 | 4929 |

Quandray | 4598 |

Login to report an issue on this page.