public class MinStack
{
Stack<int> stack = new Stack<int>();
Stack<int> min = new Stack<int>();/** initialize your data structure here. */
public MinStack(){}
public voidPush(int x){
stack.Push(x);if(!min.Any()){
min.Push(x);}else{if(x < min.Peek()){
min.Push(x);}else{
min.Push(min.Peek());}}}
public voidPop(){
stack.Pop();
min.Pop();}
public intTop(){return stack.Peek();}
public intGetMin(){return min.Peek();}}