What is claimed is:1. An information processing apparatus comprising:an interface for a medium, the medium including a mechanical switch; and circuitry configured to:detect insertion of the medium into the interface;determine whether the insertion of the medium is for inputting data into the information processing apparatus;detect a state of the mechanical switch of the medium inserted, in response to determination that the insertion of the medium is for inputting data;generate numerical data according to the state;receive, as input data, the numerical data generated; andexecute an operation according to the input data.2. The information processing apparatus according to claim 1,wherein the circuitry is configured to read data stored in a storage area of the medium and determine whether the insertion of the medium is for inputting data, according to the data read.3. The information processing apparatus according to claim 1,wherein the circuitry is configured to count the insertion in number within a given period of time, andwherein, in response to the insertion counted in number being not less than a given value, the circuitry is configured to determine that subsequent insertion of the medium is for inputting data.4. The information processing apparatus according to claim 3,wherein the circuitry is further configured to count the insertion in number within another given period of time after determining that the subsequent insertion of the medium is for inputting data, andwherein, in response to the insertion counted in number being not less than another given value, the circuitry is configured to determine that further subsequent insertion of the medium is not for inputting data and not to detect the state of the mechanical switch.5. The information processing apparatus according to claim 1,wherein the circuitry is further configured to detect removal of the medium from the interface.6. The information processing apparatus according to claim 5,wherein the circuitry is configured to measure an insertion-to-removal time from the insertion of the medium detected to the removal of the medium detected, andwherein, in response to detection of a plurality of sets of the insertion of the medium and the removal of the medium in a given order with different periods of the insertion-to-removal time, the circuitry is configured to determine that subsequent insertion of the medium is for inputting data.7. The information processing apparatus according to claim 6,wherein the circuitry is further configured to measure the insertion-to-removal time after determining that the subsequent insertion of the medium is for inputting data, andwherein, in response to continuous detection of a given number of sets of the insertion of the medium and the removal of the medium at given time intervals, the circuitry is configured to determine that further subsequent insertion of the medium is not for inputting data and not to detect the state of the mechanical switch.8. The information processing apparatus according to claim 1,wherein the circuitry is configured to retain a previous medium insertion time that is a time when the medium is previously inserted to input data, andwherein, in response to an elapse of a given period of time from the previous medium insertion time, the circuitry is configured to determine that subsequent insertion of the medium is not for inputting data and not to detect the state of the mechanical switch.9. The information processing apparatus according to claim 1, further comprising an operation device,wherein, in a state in which an operation is unacceptable through the operation device, the circuitry is configured to determine that the insertion of the medium is for inputting data.10. The information processing apparatus according to claim 1,wherein the circuitry is further configured to:detect hardware connected to the information processing apparatus; andenable the medium to interrupt an unstable detection of the hardware.11. The information processing apparatus according to claim 1, further comprising a memory,wherein the circuitry is configured to store, in the memory, an operation table associating a character string with an operation subjected to execution, andwherein the circuitry is configured to execute the operation associated with the character string with reference to the operation table.12. The information processing apparatus according to claim 1, further comprising a temporary memory,wherein the circuitry is configured to temporarily store the numerical data in the temporary memory and accumulate, as the input data, a given number of pieces of the numerical data.13. The information processing apparatus according to claim 12,wherein the circuitry is configured to retain a previous medium insertion time that is a time when the medium is previously inserted to input data,wherein the circuitry is configured to calculate a time difference between the previous medium insertion time and a current medium insertion time that is a time when the medium is currently inserted to input data, andwherein, in response to the time difference being not smaller than a given difference, the circuitry is configured to delete the numerical data stored in the temporary memory.14. The information processing apparatus according to claim 12,wherein, in response to accumulation of not less than a given number of identical pieces of the numerical data, the circuitry is configured to delete the numerical data stored in the temporary memory.15. The information processing apparatus according to claim 1,wherein the circuitry is further configured to convert the input data into a character string, andwherein the circuitry is configured to execute the operation associated with the character string.16. The information processing apparatus according to claim 1,wherein the interface is a medium slot.17. An image forming apparatus comprising:an interface for a medium, the medium including a mechanical switch; andcircuitry configured to:detect insertion of the medium into the interface;determine whether the insertion of the medium is for inputting data into the image forming apparatus;detect a state of the mechanical switch of the medium inserted, in response to determination that the insertion of the medium is for inputting data;generate numerical data according to the state;receive, as input data, the numerical data generated; andexecute an operation according to the input data.18. The image forming apparatus according to claim 17,wherein the interface is a medium slot.19. The image forming apparatus according to claim 17,wherein the circuitry is further configured to detect removal of the medium from the interface.