Count a touch in half of screen

i need to count touches in left and ride side of android screen

this my code to control player

if (Input.touchCount > 0) {

		foreach (Touch touch in Input.touches) {

			if(touch.position.x > Screen .width /2)
			{						
				doattack();
			} 

			else if (touch.position.x > Screen.width/2 ) {
				playerjump();
			}
		}			

	}

if i tap left side of screen the player does attacks again and again so, i want to do attack for single touch and another attack for another touch. (Only in left side)

remove foreach and use only Input.touches[0]

try something like this

 foreach (Touch touch in Input.touches) {

 if((touch.position.x > Screen.width / 2) && (touch.phase == TouchPhase.Began)) {

 doattack();

 }
 
 if((touch.position.x > Screen.width / 2) && (touch.phase == TouchPhase.Began)) {

 playerjump();

 }
 }

this way you will only attack and jump if you touched the specific side of the screen and you’ve only just tapped the screen.